S
Sdelphi_fu
Unregistered / Unconfirmed
GUEST, unregistred user!
如题,我有一个程序在D5中可以调用BPL包但是在D7中就出错了,我把整个程序在D7中重写的一遍还是不行,不知是什么原因,请哪位大侠帮个忙,分不鸲另加:调包程序:TcreateNewObject = function(Dataid:string) :Tobject;--定义调包方式procedure TForm1.loadpkbyname(pkname:string);var pkobject:THandle; CreateNewObject:TCreateNewObject; begin pkname:='PKlib/'+pkname; pkobject:=Loadpackage(pkname); @CreateNewObject:=GetprocAddress(pkobject,'CreateObject'); if integer(@CreateNewObject)<0 then Application.MessageBox('包加载失败!','Load Package',48) else CreateNewObject(DataID);--在这里载包时出错end;包程序是(编成BPL文件): function CreateObject :TObject; stdcall; exports CreateObject; function DestroyObject :Boolean; stdcall; exports DestroyObject;function CreateObject :TObject;begin Testfrm:=TTestfrm.Create(Application); //---也就是从这里调包程序的入口调包 Result:=TObject(Testfrm);end;function DestroyObject :Boolean;begin try Testfrm.Free; Result:=True; except Result:=False; end;end;