Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dll, freelibrary and sharemem

Status
Not open for further replies.

michaenh

Programmer
Aug 7, 2002
205
NO
Hi

Here is a code that I am trying to call a procedure from a x dll.
procedure Test;
var
i: integer;
Module: THandle;
msg: TPlugProc;
begin
i:=0;
with PlugList do
while i<Items.Count do
begin
Module:=SafeLoadLibrary(PChar(plugInsDir+Items));
try
@msg:=GetProcAddress(Module,'MyMessage');
if @msg<>nil then
msg;
finally
if Module<>0 then
FreeLibrary(Module);
end;
i:=i+1;
end;
end;

I have problems with FreeLibrary if I add Sharemem in uses clause as it describes in Borland dll project. If Sharemem is not added then it works.
Can someone explain why?
Can it be any problems without Sharemem?
Some suggestions?

thanks,
mha
 
Hi again delphi lovers.. :)

If I use FastSharemem instead of Sharemem then it works..

cheers,
mha

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top