如题
解决方案 »
- 如何动态创建DataSet或Table
- 简单的问题(100分送)
- delphi如何设置WINDOWS用户帐户和帐户有效期
- 用access本身导出的功能所导出为*.db的数据中,凡是中文字段内的内容全部“?”号,怎么办?
- webbrowser自动点击链接问题
- 誰知道在刪除一個運行的exe文件前怎麼殺死逕程???
- 关于win2000特殊共享
- 救救急吧,各位老大!如何利用Delphi实现在WINNT4.0的计划任务中添加任务,先给20分,答对再多给!
- 怎么认一个Image能够平滑快速移动而不闪动???
- 结构数组???
- fastreport3.0显示数据时小数点后边的数据都显示不出来
- 请问怎么实现套打标签?
如:
dll:
procedure f_showform(p_cnt: TADOConnection;p_handle: HWND);stdcall;
var
v_frm: TForm1;
begin
Application.Handle := p_handle;
if not p_cnt.Connected then
p_cnt.Connected := True;
v_frm := TForm1.Create(Application);
try
v_frm.ADODataSet1.Connection := p_cnt;
v_frm.ShowModal;
finally
FreeAndNil(v_frm);
end;
end;exports
f_showform;exe中调用此函数,把主窗体的adoconnection1作参数传递过去
如:
procedure TForm1.Button1Click(Sender: TObject);
var
v_handle: HWND;
v_point: Pointer;
v_showform: procedure (p_cnt: TADOConnection;p_handle: HWND);stdcall;
begin
v_handle := LoadLibrary('project1.dll');
v_point := GetProcAddress(v_handle,'f_showform');
if v_point <> nil then
begin
v_showform := v_point;
v_showform(ADOConnection1,Application.Handle);
end;
FreeLibrary(v_handle);
end;
for data warehouse databases, there are not too many users, so fast-closing the connection is not necessary