dxTabbedMDIManager + DLL窗体 出错问题

li_sj 2013-05-10 10:38:44
使用Dev dxTabbedMDIManager控件使用MDI窗口显示在TAB页面,主程序中的Mdi窗口显示没有问题,但DLL封装的Mdi窗口则出错。
有谁碰到过,指点一下

MDIForm

type
TProc = procedure(MyApplication: TApplication; MyParent: TForm); stdcall;

……
var
formMain: TformMain;
th: THandle;

implementation

{$R *.dfm}

procedure TformMain.ReadDLLForm(sDLLHandle: PWideChar;Parent:PAnsiChar) ;
var
tp: TProc;
label isLoad;
begin
isLoad:
if th <= 0 then
begin
th := LoadLibrary(sDLLHandle);
goto isLoad;
end
else
@tp := GetProcAddress(th, Parent);
if @tp <> nil then
tp(Application, Self);
end;

initialization

finalization
if th > 0 then
FreeLibrary(th);

end.


MDIChild
……
{$R *.res}
var
DLLApp: TApplication;

procedure CreateDLL_formSalesList(App: TApplication; MyParent: TForm); stdcall;
begin
Application := App;
formSalesList := TformSalesList.Create(MyParent);
end;

procedure DllUnload(Resean: Word); register;
begin
if Resean = DLL_PROCESS_DETACH then
Application := DLLApp;
end;

exports CreateDLL_formSalesList;

begin
DLLApp := Application;
DllProc := @DllUnload;
end.
...全文
468 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
fxtest 2014-11-23
  • 打赏
  • 举报
回复
同样的问题。
xmtrpg 2014-04-30
  • 打赏
  • 举报
回复
我也遇到同样的问题!
Stiven_PFan 2014-04-21
  • 打赏
  • 举报
回复
看到MDI就想呕吐,其实完全可以不用MDI的。
吴说扒道 2014-04-20
  • 打赏
  • 举报
回复
顶,我也遇到同样的问题,请楼上的帮忙解决啊,谢谢
jiangzs188136923 2013-05-10
  • 打赏
  • 举报
回复
多年稳定运行,可提供开发平台。你的问题看似简单。涉及到很技术细节。
jiangzs188136923 2013-05-10
  • 打赏
  • 举报
回复

完美实现。可以交流。QQ:188136923

5,928

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧