急问!谢谢大家!
解决方案 »
- 使用SHChangeNotifyRegister函数监控系统文件操作,但是如果一次复制->粘贴大于10个文件时,怎么会只获得10个建立文件的消息呢?
- 请问,如何同时打开多个窗口?
- TeeChart能否实现多个纵轴的显示,例如温度/压力/电压 相同时间内的值的表示?
- 关于ACCESS数据库.急...
- 在线等待
- delphi中用ADO的Microsoft OLE DB连接Oracle不行,其他可以,怎么解决
- 著名国产软件,郝新庚的《电子日记本》2.0正式版终于发布了,希望大家都来支持一下
- 如何将数据库中的IMAGE字段的内容显示出来
- 关于delphi数据导到EXCEL报错的问题
- 用query添加记录时,系统怎样能够自动为我在数据库中的ID字段赋值?
- 请问哪儿有好用的万能查询控件用
- Fastreport中如何动态画线条
有模式的要传当前窗口的handle.
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
Forms,
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}
procedure ShowMainForm;
var
frm : TForm1;
begin
frm := TForm1.Create(Application);
frm.ShowModal;
frm.Free;
end;
exports
ShowMainForm;
begin
end.
//////////////
unit Unit2;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure ShowMainForm; stdcall;
var
Form2: TForm2;implementation{$R *.dfm}
procedure ShowMainForm;external 'Project1.dll';procedure TForm2.Button1Click(Sender: TObject);
begin
ShowMainForm;
end;end.
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
Forms,
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}
procedure ShowMainForm;
var
frm : TForm1;
begin
frm := TForm1.Create(Application);
frm.ShowModal;
frm.Free;
end;
exports
ShowMainForm;
begin
end.这样创建的话,任务栏会出现另外的窗体,但我想要DLL的窗体是EXE的子窗体哦
请问怎样创建模式窗体?
我传递了Handle,但是执行DLL的Application.Handle := h;//(传递进DLL的EXE窗体句丙)
后,Application.Handle还是为0,窗体创建失败,报错哦
var
frm : TForm1;
begin
application.handle := h;
frm := TForm1.Create(Application);
frm.ShowModal;
frm.Free;
end;
调用 ShowMainForm(handle);
application.handle:=h;
form1.showmodal;showmainform(application.handle);
Handle:=loadlibrary('路径');
。
freelibrary();
只要保证在DLL里创建FORM就可以了呀?
我还是用DELPHI做的DLL,VC里调用的....(不过那也只是测试)
不过代码在我家.......