问题: 那位大哥做过dll中的子窗体的 ( 积分: 200 )
分类: 控件 - 开发
来自: KervenLee, 时间: 2003-05-29 11:26:00, ID: 1905481
子form上的菜单与主form上的菜单融合后,菜单事件执行后,关掉主form出错啊
各位是如何解决的!
来自: KervenLee, 时间: 2003-05-29 11:26:00, ID: 1905485
最好给个例子
kevinhlj@msn.com
来自: 风雨燕归来, 时间: 2003-05-29 11:39:00, ID: 1905537
兄弟我也不是到处蹭饭吃的
只不过是正巧俺也有这个问题
烦有的兄弟给我也发一份
fengxiaobao@163.com
来自: liuri, 时间: 2003-05-29 11:40:00, ID: 1905539
没做过,进来听教
来自: thx1180, 时间: 2003-06-02 16:29:00, ID: 1917765
一个简单的dll窗体:
library Dllform;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1};
{$R *.RES}
exports
TestDll;
begin
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
procedure FormDblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure TestDll(nHwnd: THandle); stdcall;
implementation
{$R *.DFM}
procedure TestDll(nHwnd: THandle);
begin
Application.Handle := nHwnd;
with TForm1.Create(Application) do
try
ShowModal;
finally
Free;
end;
end;
procedure TForm1.FormDblClick(Sender: TObject);
begin
Close;
end;
end.
调用单元:
unit Unit_test;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
procedure TestDll(nHwnd: THandle); stdcall; external 'Dllform.dll';
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
TestDll(Application.Handle);
end;
end.
来自: KervenLee, 时间: 2003-06-04 7:59:00, ID: 1922702
我要带有菜单的,
你们试试?怎么解决啊?
来自: 魔鬼大师, 时间: 2003-06-21 23:03:00, ID: 1971427
子form没free
来自: jianl, 时间: 2003-07-03 20:25:00, ID: 2001078
又是一个退出报错的吗?99%是这个问题
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1772610
来自: wr960204, 时间: 2003-07-04 12:39:00, ID: 2002662
是李文凯吗?
来自: KervenLee, 时间: 2003-07-07 11:32:00, ID: 2008158
王锐,是我阿
来自: KervenLee, 时间: 2003-08-22 12:58:00, ID: 2127002
多人接受答案了。
问题讨论没有结束 ...