如何将DLL文件附加到主程序中的一个控件TabSheet1中成为一部分
就像一个程序中有多个功能,但是这个是分离的,必须加载那个DLL
文件后,TabSheet1中才能有相应的功能:
主程序main.exe 有控件RzPageControl1,内有TabSheet1--TabSheet6
窗体库文件STUDGLS.dll嵌入一个TabSheet1显示,选用TabSheet1项再调用
STUDGLS.dll并能完成相关独立的基本操作》》》》》》》》》》
就像一个程序中有多个功能,但是这个是分离的,必须加载那个DLL
文件后,TabSheet1中才能有相应的功能:
主程序main.exe 有控件RzPageControl1,内有TabSheet1--TabSheet6
窗体库文件STUDGLS.dll嵌入一个TabSheet1显示,选用TabSheet1项再调用
STUDGLS.dll并能完成相关独立的基本操作》》》》》》》》》》
解决方案 »
- 求助,关于win8用BDE连接非1433端口sql2000的问题
- WebBrowserBeforeNavigate2中的Headers如何获取?
- 用delphi写个用户注册的程序。
- 一个每秒调用3次的函数中要声明100个值不变的常量,如果把这些常量设置为全局的是否效率更高!
- 谁能给我发一份进销存的程序有源代码
- 用delphi开的程序在win2000中可以。为什么在XP中不可以。
- 请问如何用INI文件控制数据库连结信息?
- 如何在win2000下实现打印一行记录后不走纸
- SQL Server+DELPHI的问题
- 各位大侠很简单的问题,来拿分啊。
- 判断一个数据集中的记录的个数
- chart图形柱形图时,怎么设置可以在柱子顶上显示数值?
把它的parent设置为此tabsheet,大小、位置正好充满
unit Unitmain;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
btn1: TButton;
Panel1: TPanel;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
procedure synapp(app:THandle);stdcall;external 'mydll.dll';
function showform(app:THandle):TForm;stdcall;external 'mydll.dll';
implementation
uses Math;{$R *.dfm}procedure TForm1.btn1Click(Sender: TObject);
var
tmpform:Tform;
begin
synapp(Application.Handle);
tmpform:=showform(Panel1.Handle);
end;end.DLL部分----------------
library mydll;{ 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
synapp,showform; //输出的函数
begin
end.
DLL里窗体部份-----------------也就是输出函数的实现
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls;type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
procedure synapp(app:THandle);stdcall;
function showform(app:THandle):TForm;stdcall;implementation
uses Math;{$R *.dfm}
procedure synapp(app:THandle);stdcall;
begin
Application.Handle:=app;
end;function showform(app:THandle):TForm;stdcall;
begin
Form1:=TForm1.Create(Application);
Form1.ParentWindow := app;
Form1.Height:=100;
Form1.Width :=100;
// Form1.Align :=alClient;
Result:=Form1;
Form1.Show;
end;
end.
请你发一些DEMO程序到谢谢
请你发一些DEMO程序到谢谢