调用DLL中的MDICHILD窗体后,过一段时间,窗体自动关闭,主程序无响应。主程序和DLL都没带包编译。
解决方案 »
- 如此的调用线程,为何不起作用?
- 晕头了:Byte数组与OleVariant类型互转问题
- 马上结~~~
- 搞Delphi的软件公司除了在做mis,变相的mis(包括erp,crm.....)还在做什么?
- 往数据集中输入数据时,当移到下一条记录时,上一条记录自动清空?
- 怎麼豎立著放置DBNavigator控件???
- 请问用Delphi6的QuickRep能不能从数据库中取出多行文本并打印?
- 求图片移动的无闪烁方法
- 谁能提供条码控件。for d6 谢谢
- 超菜问题给高分!Windows的API函数中的消息是指什么?
- cxGrid主从表实现问题
- delphi的memo问题,怎么将在memo中输入换行后的多行数据都保存到数据库的一个字段下面
FormHandle:hwnd;
dllapp:tapplication;
procedure LoadsysreportDLL(PApplication:TApplication;PForm: TForm;FormName:shortString;MainHandle:integer;datamodule:Tfrm_dm;pdepartment:shortstring); export; stdcall;
begin
Application:=PApplication;
// Screen := Scr;
FormHandle:=MainHandle;
frm_dm:=datamodule;
depment:=pdepartment;
if FormName='frm_count' then
begin
if not Assigned(frm_count) then
frm_count:= Tfrm_count.Create(PForm);
end; if FormName='frm_order' then
begin
if not Assigned(frm_order) then
frm_order:=Tfrm_order.Create(PForm);
end; if FormName='frm_plantp' then
begin
if not Assigned(frm_plantp) then
frm_plantp:=Tfrm_plantp.Create(PForm);
end; if FormName='frm_time' then
begin
if not Assigned(frm_time) then
frm_time:= Tfrm_time.Create(PForm);
end;
end;
procedure DLLUnloadProc(Reason:Integer);register;
begin
if (Reason=DLL_PROCESS_DETACH) or (Reason=DLL_THREAD_DETACH) then
begin
if assigned(frm_count) then
frm_count.Free;
if assigned(frm_order) then
frm_order.Free;
if assigned(frm_plantp) then
frm_plantp.Free;
if assigned(frm_time) then
frm_time.Free;
Application:=DllApp;
CoUnInitialize;
end;
end;
exports LoadsysreportDLL;
begin
DllApp:= Application;
CoInitialize(nil);
DLLProc := @DLLUnloadProc;
end.