小弟只有100分了,请各位大侠帮帮忙!急啊!!(万分感谢---在线等待)

linqiu6 2002-06-04 10:07:26
1.在DLL中实现的窗体,如何可以成为Mdi中的子窗体,我把窗体的formstyle设为fsmdichild了,但我在程序中调用时会出错(提示:no mdi forms are currently active).
2.如何把dll中的窗体的菜单合并到主窗体中的菜单中.
...全文
79 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
taxi 2002-06-05
  • 打赏
  • 举报
回复
我的方法可以呀。
taxi 2002-06-04
  • 打赏
  • 举报
回复
信被退回来了,你按照我贴的原代码做就可以了。
linqiu6 2002-06-04
  • 打赏
  • 举报
回复
再发一份吧,我再等一会儿,谢了
taxi 2002-06-04
  • 打赏
  • 举报
回复
不会吧,我发了呀。
linqiu6 2002-06-04
  • 打赏
  • 举报
回复
还没有收到
taxi 2002-06-04
  • 打赏
  • 举报
回复
不知道。
linqiu6 2002-06-04
  • 打赏
  • 举报
回复
补充:
我现在的这个dll是可以供vb使用的,不知道菜单合并有没有用
taxi 2002-06-04
  • 打赏
  • 举报
回复
已发。
linqiu6 2002-06-04
  • 打赏
  • 举报
回复
e-mail:linqiu@163.net
knock 2002-06-04
  • 打赏
  • 举报
回复
必须把主窗口设为MDI父窗口
taxi 2002-06-04
  • 打赏
  • 举报
回复
把Email留下来,我把程序源码发给你看看。
taxi 2002-06-04
  • 打赏
  • 举报
回复
菜单合并和在一个应用程序做MDI菜单合并一样,主要是设置菜单的GroupIndex属性
taxi 2002-06-04
  • 打赏
  • 举报
回复
主窗体源代码
unit MainFrm;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Menus, ComCtrls, ToolWin;

type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
F1: TMenuItem;
fsdf1: TMenuItem;
fsdfsd1: TMenuItem;
fdsfds1: TMenuItem;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

procedure ShowForm(MainApp: TApplication); stdcall; external 'DLL.dll' name 'ShowForm';

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure Search(Position: Integer);
begin
ShowMessage(IntToStr(Position));
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
ShowForm(Application);
end;

end.

//dll源代码
library DLL;

{ 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
Windows,
SysUtils,
Classes,
Dialogs,
Forms,
DllFrm in 'DllFrm.pas' {ChildForm};

{$R *.res}

var
DllApp: TApplication;

procedure ShowForm(MainApp: TApplication); stdcall;
begin
if not Assigned(DllApp) then
begin
DllApp := Application;
Application := MainApp;
end;

Application.CreateForm(TChildForm, ChildForm);
end;

procedure DllEntryPoint(dwReason: Integer);
begin
if dwReason = DLL_PROCESS_DETACH then
begin
if Assigned(DllApp) then
Application := DllApp;
end;
end;

exports
ShowForm;

begin
DllProc := @DllEntryPoint;
end.

5,928

社区成员

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

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