我建了一个DLL,我想让DLL所在的窗体,显示在主界面的PANEL1里,但是老是显示不出来,请大家帮我看看,错在哪里?//dll
library dll;
uses
SysUtils,
windows,
Classes,
controls,forms,
dllform in 'dllform.pas' {FrmDLLChild};{$R *.res}var
DLLApp: TApplication;function GetDllChildForm:TFrmDLLChild; stdcall;
begin
Result:= TFrmDLLChild.Create(application);
end;procedure InitDLL(App: TApplication); stdcall;
begin
DLLApp := Application;
Application := App;
end;procedure FreeDLL; stdcall;
begin
Application := DLLApp;
end;exports
InitDLL, FreeDLL, GetDllChildForm;
begin
end.
主窗体调用:
with GetDllChildForm do
begin
parent:=form1.Panel1; //把这句去掉就能显示但显示不到PANEL1里,我想让DLL所在窗体显示在pan
Show;
end;
library dll;
uses
SysUtils,
windows,
Classes,
controls,forms,
dllform in 'dllform.pas' {FrmDLLChild};{$R *.res}var
DLLApp: TApplication;function GetDllChildForm:TFrmDLLChild; stdcall;
begin
Result:= TFrmDLLChild.Create(application);
end;procedure InitDLL(App: TApplication); stdcall;
begin
DLLApp := Application;
Application := App;
end;procedure FreeDLL; stdcall;
begin
Application := DLLApp;
end;exports
InitDLL, FreeDLL, GetDllChildForm;
begin
end.
主窗体调用:
with GetDllChildForm do
begin
parent:=form1.Panel1; //把这句去掉就能显示但显示不到PANEL1里,我想让DLL所在窗体显示在pan
Show;
end;
解决方案 »
- 奇怪的软件
- 一个很头疼的问题(类的相互调用)
- 神龙卡播放文件的问题?
- 在线等~谁有组合查询的程序段??
- 各位给提供点图标资源下载地址,谢谢
- 采用Midas&Com+开发分步式系统,客户端通过什么方式将数据传输到服务器端?
- 如何向数据库中添加图片
- 我想在不关心DBGRID的数据源的情况下,把它里面所显示的内容整齐地写到一个文本文件里,应该怎样做?(急)
- 能将EDIT组件透明吗?只显示可控制颜色的框。
- 怎样设置Tpen的Style???????delphi的debug吗???
- 再开一帖,两帖一起接分!想在framesell中获得另一个窗体(或frame)的参数,编译时出错!高手呢?在线等!
- 关于循环引用的类如何定义
windows.SetParent(子窗体的句柄,Panel.Handle);
你好, 子窗体的句柄,是什么,应该怎么获得这个句饼,能举个例子吗?
在你的程序中应该是把
parent:=form1.Panel1;
改成
windows.SetParent(Handle, Form1.Handle);