回复:delphi的DLl调用(急急急!!!!)
dll中的代码
uses SysUtils, ShareMem,
Classes;{$R *.res}
function TESTDLL(aa:Pchar):Pchar;stdcall;
begin
result:=aa;
end;
exportsTESTDLL;
end.
就是这一段代码,在DELPHI中运行的时候,执行的时候不会出现错误,当我关闭运行的窗体的时候就报出一个错误.
在前台窗体调有的代码.sharemem已经加入到uses中.
function TESTDLL(aachar)char;stdcall;
external 'project2.dll';
procedure TForm1.Button1Click(Sender: TObject);
edit1.Text:=inttostr(y);
end;
end.
当我结运行的时候,就会弹出"project project1.exe raised exception class EInvalidpointer with message 'invalid pointer operation',process stopped.use step or run to continue'提示,在LR中也是出错误.