MDI的问题exe是fsMDIForm
dll是fsMDIChild
exe静态调用dll创建窗体
麻烦问下为什么exe的 MDIChildCount值为0的说
我看了下MDIChildCount是获取Screen的数量,
难道调用dll创建的不属于Application.MainForm的MDIChild吗?
怎样才可以让调用dll创建出来的Form属于exe的MDIChild?
下面是dll的代码
library dllForm;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.MDIEXEdllWindowsDelphi
dll是fsMDIChild
exe静态调用dll创建窗体
麻烦问下为什么exe的 MDIChildCount值为0的说
我看了下MDIChildCount是获取Screen的数量,
难道调用dll创建的不属于Application.MainForm的MDIChild吗?
怎样才可以让调用dll创建出来的Form属于exe的MDIChild?
下面是dll的代码
library dllForm;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.MDIEXEdllWindowsDelphi
解决方案 »
- 请问如何用鼠标滚轮来放大或缩小图片的大小?如何入手呢?
- 请问delphi7有没有汉化的帮助?
- 谢谢各位高手帮忙,分数不够QQ联系加给你,每天加,每时加,每秒加!
- DELPHI +SQL SERVER2000 如何提取最小值
- 一个权限管理的问题
- [ 请教一个初级问题!----关于工程 ]
- 请问使用infopower控件组如何连接sqlserver数据库有什么好的方式
- 如何设置目录的访问权限?
- 为什么我一改了application的图标,运行时就出现那个显示cpu信息 的窗体?
- 急,为什么dbedit不能操作query的结果集??dbedit只能操作table吗????(牛虻)
- delphi xe3编译的程序,右键菜单是英文的,怎么整成中文的啊?
- 有个delphi开发的管理软件,没有源码,如何修改关键功能呢
testform.parent := parentform;
exe的MDIChildCount任然为0
formHWND2^:=form1.handle; //获取HANDLE返回到EXE
但是……但是 问题出到这个但是上了
我脑抽了下试着又把screen取消掉在次试了下.发现居然exe的MDIChildCount值居然和dll的一致 exe自行创建的ChildForm和dll创建的ChildForm居然任然都正常,exe和dll的Screen两个值居然还是同步的.
不死心有重建了个工程拿来测试结果仍然正常,嘛嘛这什么和什么啊.害我纠结了2天
用bpl方式比较稳定安全,但是编译发布不方便
经过各种测试最后结论,如果要dll和exe的screen 同步
只能在dll写入exe的screen.