A
asphunter
Unregistered / Unconfirmed
GUEST, unregistred user!
VC写的DLL中的方法:<br>char* myStrCopy(char* str1,char* str2)<br>{<br> char* tmp="";<br> strcpy(tmp,str1);<br><br> return tmp;<br>}<br><br>Delphi调用方法:<br>function myStrCopy(str1char;str2char)char;stdcall;external 'testDLL.dll' name 'myStrCopy';<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>var<br> a,b,cchar;<br>begin<br> a:='abc';<br> b:='123';<br> c:=myStrCopy(a,b);//执行到此步时出错,提示说:在testDLL.dll中的无效访问地址<br> showmessage(c);<br>end;