[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: Type 61



Hi Michael,

thanks for your email, but sorry, no, this doesn't work, even if I rename the file. Are you sure, the source code is correct?

There is no promblem with using the fortran dll again. I just have to copy it into the folder again and then it works.

Isn't there anybody who ever created delphi dlls??

Joern

 


-----Ursprüngliche Nachricht-----
Von: Michaël Kummert [mailto:kummert@engr.wisc.edu]
Gesendet: Dienstag, 6. Mai 2003 16:28
An: trnsys@relay.doit.wisc.edu
Betreff: RE: Type 61


Dear Joern,

I think the quick fix is to use the first version you propose (with "library
EXTDLLP;") and rename the created DLL to ExtDLL.dll instead of ExtDLLP.dll.
The ExtDLLP name is there because the Delphi compiler refused to use the
same name for "library" and for the procedure and exports (at least at the
time we tested it). Once you have an ExtDLL.dll file in \Trnsys15, Trnsys
should find it without any problem.

To get the Fortran ExtDLL to work again, you should rebuild the "ExtDLL"
project in the CVF6.6 workspace included with TRNSYS. If you want to check
the project settings, they are listed on the TRNSYS web site: 
http://sel.me.wisc.edu/trnsys/compilers/cvf66b.htm (see section 3).
To make sure you rebuild ExtDLL, go to "Project/Set Active Project" and
select ExtDLL. Then Go to "Build/Rebuild all". 
The compiler should display the following: 
Creating library \Trnsys15/ExtDLL.lib and object \Trnsys15/ExtDLL.exp 
ExtDLL.dll - 0 error(s), 0 warning(s) 
Check the date of ExtDLL.dll in \Trnsys15 to make sure everything worked.
ExtDLL.dll is the only file required to run (the compiler also creates
ExtDLL.exp, ExtDLL.ilk, ExtDLL.lib but they are not required to run TRNSYS)

Hope this helps,

Michaël Kummert

_________________________________________________________

Michaël Kummert

Solar Energy Laboratory - University of Wisconsin-Madison
1303 Engr Res Bldg, 1500 Engineering Drive
Madison, WI 53706

Tel: +1 (608) 263-1589
Fax: +1 (608) 262-8464
E-mail: kummert@engr.wisc.edu

SEL Web Site: http://sel.me.wisc.edu 
TRNSYS Web Site: http://sel.me.wisc.edu/trnsys




> -----Original Message-----
> From: owner-trnsys@relay.doit.wisc.edu
> [mailto:owner-trnsys@relay.doit.wisc.edu] On Behalf Of Herr von Grabe
> Sent: Tuesday, May 06, 2003 02:36
> To: trnsys@relay.doit.wisc.edu
> Subject: Type 61
> 
> 
> Hallo!
> 
> I have the following problem:
> 
> I am trying to use the type 61 dll routine.The simple example
> Extdll.dll routine runs but my own Delphi source code seems 
> not to work. I have tried the following source code (which 
> seems to be going around here):
> 
> library EXTDLLP;
> 
> {$R *.RES}
> {$D+; L+}
> 
> 
> uses
>   SysUtils,
>   Classes;
> 
> type
> 	chr280 = array[0..280] of char;
> 	realarray100 = array[1..100] of single;
> 	realarray4 = array[1..4] of single;
> 	doublearray100 = array[1..100] of double;
> 	intarray15 = array[1..15] of integer;
> 
> procedure EXTDLL (var Spass:chr280; var
> SArrayPass:realarray100; var SimArray:realarray4;
> 						var 
> XIn:doublearray100; XOut:doublearray100; var T, DTDT:realarray100;
> 						var 
> Par:realarray100; var Info:intarray15; var 
> ICtrl:intarray15);export;stdcall;
> 
> begin
> 	XOut[1] := XIn[1] * XIn[2];
> 	SPass := 'Gruß aus der externen DLL!';
> end;
> 
> exports
> 	EXTDLL;
> 
> begin
> end.
> 
> 
> It does not work, and I think this is because it is not an
> Extdll.dll file created but an EXTDLLP.dll file. That is not 
> exactly the required name for the file. So I tried the following:
> 
> library EXTDLL;
> 
> {$R *.RES}
> {$D+; L+}
> 
> 
> uses
>   SysUtils,
>   Classes;
> 
> type
> 	chr280 = array[0..80] of char;
> 	realarray100 = array[1..100] of single;
> 	realarray4 = array[1..4] of single;
> 	doublearray100 = array[1..100] of double;
> 	intarray15 = array[1..15] of integer;
> 
> procedure EXTDLLU (var Spass:chr280; var
> SArrayPass:realarray100; var SimArray:realarray4;
> 						var 
> XIn:doublearray100; XOut:doublearray100; var T, DTDT:realarray100;
> 						var 
> Par:realarray100; var Info:intarray15; var 
> ICtrl:intarray15);export;stdcall;
> 
> begin
> 	XOut[1] := XIn[1] * XIn[2];
> 	SPass := 'Gruß aus der externen DLL!';
> end;
> 
> exports
> 	EXTDLLU name 'EXTDLL';
> begin
> end.
> 
> 
> That is not working either! Is there anything wrong and I am
> just too blind to see?? What about the extdll.lib file? If it 
> is deleted even the original example does not work anymore! 
> Do I have to change this file as well??
> 
> 
> Hoping for help,
> 
> Joern
> 
> -------------------------------------------------
> Dipl.- Ing. M.Sc. Jörn von Grabe
> 
> Michael Lange
> Beratender Ingenieur VBI 
> Wilmersdorfer Straße 145-146
> 10585 Berlin
> 
> Telefon: +49 (30) 347998-0
> Telefax: +49 (30) 347998-33
> E-Mail: vGrabe@michael-lange.de 
> Internet: www.michael-lange.de 
> -------------------------------------------------
>