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
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