X
xiaojun5556
Unregistered / Unconfirmed
GUEST, unregistred user!
library Project2;uses SysUtils, Classes, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'main/Unit2.pas';{$R *.res}procedure run_cancel_service(var param:tmy_object);begin myobj:=param; Form1:=tForm1.create(nil); //我在form1show的时候 showmessage(myobj.name);就出错 Form1.showmodal; Form1.free; end;exports run_cancel_service;beginend.主程序procedure TForm1.Button1Click(Sender: TObject);var handle : THandle; run_cancel_service : Trun_cancel_service ; my_object : tmy_object;begin my_object := Tmy_object.Create ; my_object.name := 'aaa'; my_object.pass := '123'; handle:=loadlibrary('Project2.dll'); if handle <> 0 then @run_cancel_service := getprocaddress(handle,'run_cancel_service'); if @run_cancel_service <> nil then run_cancel_service(my_object) ;end;我定义的tmy_object Unit2;interface type tmy_object = class name : string[100]; pass : string[100]; end;帮我改下啊谢谢了当调用的时候出错