MDI静态调用DLL创建窗体的问题
MDI的问题
exe是fsMDIForm
dll是fsMDIChild
exe静态调用dll创建窗体
麻烦问下为什么exe的 MDIChildCount值为0的说
我看了下MDIChildCount是获取Screen的数量,
难道调用dll创建的不属于Application.MainForm的MDIChild吗?
怎样才可以让调用dll创建出来的Form属于exe的MDIChild?
下面是dll的代码
library dllForm;MDI EXE dll Windows Delphi
uses
SysUtils,
Classes,
Forms,
Windows,
test_Form in 'test_Form.pas' {testForm};
{$R *.res}
var
DLLApp: TApplication;
procedure ShowChild(ParentApplication:TApplication;ParentForm:TForm);stdcall;
begin
Application:=ParentApplication;
testForm:=TtestForm.Create(ParentForm);
testForm.Show;
end;
procedure DLLUnloadProc(Reason:Integer);register;
begin
if Reason=DLL_PROCESS_DETACH then Application:=DLLApp;
end;
exports
ShowChild;
begin
DLLApp:=Application;
DLLProc := @DLLUnloadProc;
end.