请教:DLL如何使用主程序的ADOConnection?

ILoveEagles 2006-10-28 11:54:39
如题
...全文
270 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ILoveEagles 2006-11-02
  • 打赏
  • 举报
回复
难道没有了?
ILoveEagles 2006-10-30
  • 打赏
  • 举报
回复
TO zsr(老牛) :能不能详细点
zsr 2006-10-29
  • 打赏
  • 举报
回复
用Ado的原生对象,传入_connection就可以了。
sbli 2006-10-29
  • 打赏
  • 举报
回复
没用过帮顶
cloudtarget 2006-10-28
  • 打赏
  • 举报
回复
FCn可以定义在TChdaForm里面
cloudtarget 2006-10-28
  • 打赏
  • 举报
回复
你传进去不就得了,举个例子
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;

procedure SetOldApplication;stdcall;export;
begin
Application:=FApp;
end;

exports
GetFormOne,SetOldApplication;

begin
FApp:=Application;
end.

2,498

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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