From a quick glance, I don't see whats wrong. So I'll show you another way of doing it that is common:
[pascal]unit test;
interface
type
TMyProc=procedure(SomeVar1, SomeVar2 : PChar); cdecl;
var
MyProc : TMyProc;
procedure LoadProcs;
implementation
procedure LoadProcs;
var
l : Cardinal;
begin
l := LoadLibrary('MyDLL.dll');
if l <> nil then
begin
@MyProc := GetProcAddress(l, 'FOO');
end;
end;
end.[/pascal]
Then later to call it:
[pascal]
MyProc('Test1', SomeOtherPChar);
[/pascal]
While this is FPC source it should work for you. Also you might try taking a look at the Dr Bob's article (a bit dated, but still useful) at: http://www.drbob42.com/delphi/headconv.htm
Bookmarks