Board index » delphi » calling dll's from Delphi 3

calling dll's from Delphi 3

From Delphi 3 in Windows NT I call a LaHey Fortran dll using LoadLibrary to
get the dll handle, and FreeLibrary to release the dll:

Handle:= LoadLibrary('filter.dll');
..
FreeLibrary(Handle);

When I repeat this several times two unwanted effects occur:

1 The memory used by the dll is not released, while no shared memeory is
used. 2 The dll gives different results every time it is called, while they
should be equal.

Does anybody have an idea what might be the cause and what could be done
about it? All suggestions are appreciated!

Greetings,

Frank Tap

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

 

Re:calling dll's from Delphi 3


Dear Frank,

I don't know exacly what kind of functions are included in the dll, but
because
of the name 'filter' I suppose it has something to do with strings.
You can't pass strings to a dll (unless you add sharemem to the uses clause
of both the unit and the dll unit)
Instead try using PChar. This will work fine and spare you the overhead of
sharemem.pas

Greets,

Almer. S. Tigelaar
alme...@usa.net

Other Threads