如题
解决方案 »
- 一个关于【VPN】的问题
- 请大家帮看下,C++的定义我用delphi写了下不知对不对。
- 如何判断shelllistview当前在那个目录
- bmp保存不能显示
- delphi7.0 和 delphi V7.0 是同一个版本吗,他们有什么区别?
- Delphi中有没有类似fnmatch的函数
- 所谓的sdk编程,指的是什么,sdk是什么意思,包含了哪些技术呢?
- 初来,问个问题?
- 请问,在Delphi的调试中,如何设置条件?
- adodataset和adoquery哪个好用一点?
- 在时间函数timer里面能调用moniterthread.execute的过程?
- delphi sqlserver2000 XML 问题
将TabSheet以参数方式传入子模块
设置模块窗体的Parent:= TabSheet
另外,Dll窗口要用非模式show显示而不是showmodal,否则键盘鼠标就没反映了。
Forms,SysUtils,Classes,windows,
Unit_FrmSelectWorker in 'Unit_FrmSelectWorker.pas' {FrmSelectWorker};Function Run(Aparent:TWinControl):Boolean;stdcall;
begin
FrmSelectWorker:=TFrmSelectWorker.Create(Aparent);
FrmSelectWorker.Show;
Result:=true;
end;procedure MyDLLHandler(Reason: integer);
var
a:integer;
begin
case Reason of
DLL_Process_Attach: a:=0;
DLL_Process_Detach: FrmSelectWorker.Free;
DLL_Thread_Attach: a:=0;
DLL_Thread_Detach: a:=0;
end;
end;
{$R *.res}
exports
Run;
begin
end.
用bpl则所有问题都不存在,而用法基本上与dll类似。
请采用动态编译编译工程,并拷贝运行时所需要的的bpl及dll文件。
这些我都试过了,相类似的办法也都试过了,都不行!
好象这主程序都不肯承认这个寄生的外来仔(dll窗口)
请大家继续......
library Chda;{ 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,
Forms,
ExtCtrls,
windows,
ADODB,
你自己的工程文件;{$R *.res}Function GetFormOne(aCn:TADOConnection;aApp:TApplication;aModuleName:PChar):TForm; export; stdcall;
begin
FCn:=aCn;
FModuleName:=aModuleName;
Application:=aApp;
Result:=TChdaForm.create(Application);
end;----------------------------------------在得到dll时调用procedure SetOldApplication;stdcall;export;---------dll消毁时调用,如整个应用程序退出
begin
Application:=FApp;
end;exports
GetFormOne,SetOldApplication;----------导出创建窗体和设置原来Applicationbegin
FApp:=Application;-------------------这里dll一开始就保存原来的对象
end.像这样所有机制都这样了,当然楼主可以把所有这些dll handle作为数组保存,虽然步骤多一个,但是效果是全部能够达到的
To StarRains(星雨):详细说一下。
TO callzjy(经常性地总结性地理一理):好!!!