N
netfly
Unregistered / Unconfirmed
GUEST, unregistred user!
我在DLL里申明一个如下的函数,调用的程序是一个MDIFORM。
tmpApplication:=TApplication.Create(Nil);
tmpApplication.handle:=Application.handle;
Application.handle:=AppHand; //obtian the system handle
with TfrmUserManager.Create(Application) do
begin
try
FormStyle:=fsMDIChild; //《----运行出错 //不用这行代码,直接在FORM的属性里设置也出错。
Show;
Result:=Handle;
except
free;
Result:=0;
raise;
end;
end;
Application.handle:=tmpApplication.handle;
tmpApplication.free;
tmpApplication:=TApplication.Create(Nil);
tmpApplication.handle:=Application.handle;
Application.handle:=AppHand; //obtian the system handle
with TfrmUserManager.Create(Application) do
begin
try
FormStyle:=fsMDIChild; //《----运行出错 //不用这行代码,直接在FORM的属性里设置也出错。
Show;
Result:=Handle;
except
free;
Result:=0;
raise;
end;
end;
Application.handle:=tmpApplication.handle;
tmpApplication.free;