function GetString: string;export;
begin
result:='test';
end;
exports GetString;
end.
strings are no standart types and cannto exported from an library
without special memmanager, use pchar
+++++++++++++++++++++++
and here how it is called
+++++++++++++++++++++++++
var
libhandle: TLibHandle;
GetStringAddr: function: string;
str: string;
begin
libhandle:=LoadLibrary('libtestlib1');
pointer(GetStringAddr):=GetProcAddress(FLibraryHandle, 'GetString');
str:=GetStrAddr();
writeln(str)
unloadLibrary(libhandle);
writeln(str)
end.
+++++++++++++++++++++++
It always crashes when I want to write 'str' the second time :(
Sebastian
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives