刚开始学delphi,用MFC写了一个WIN32的DLL函数然后,想从delphi中调用, WIN32 函数是:
extern "C" __declspec(dllexport) int AddNum(int k, int m)
{
return k+m;
}调用过程是:
DLLInstance := LoadLibrary('E:\\delphi\\DelphiTest\\Debug\\DelphiTest.dll');
if DLLInstance = 0 then
begin
MessageBox(0,'Loading Wrong','Error',0);
end else begin
FunC := GetProcAddress(DLLInstance,'AddNum');
sum := FunC(num1,num2);
msg := IntToStr(sum);
MessageBox(0,PChar(msg),'Result',0);可是无论如何结果总是不是5762882.
请帮忙解决一下.