From 89200985f4f67d0589af4d3fa4e31a2a24eb1054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cddf=E2=80=9D?= <“ddf668490@163.com”> Date: Tue, 16 Jul 2024 21:54:28 +0800 Subject: [PATCH] 1 --- public10/ThreeFun/Fun/U_dynamicsDll.pas | 86 +++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 public10/ThreeFun/Fun/U_dynamicsDll.pas diff --git a/public10/ThreeFun/Fun/U_dynamicsDll.pas b/public10/ThreeFun/Fun/U_dynamicsDll.pas new file mode 100644 index 0000000..5c97a35 --- /dev/null +++ b/public10/ThreeFun/Fun/U_dynamicsDll.pas @@ -0,0 +1,86 @@ +unit U_dynamicsDll; + +interface +uses + Windows, Messages, SysUtils,Dialogs, Variants, Classes,Forms; + + function showFr3LableForm(userCode:string;userName:string;connStr:string;title:string):integer; + function showRmfLableForm(userCode:string;userName:string;connStr:string;title:string):integer; + var + newh: hwnd; + +implementation + +//ʾreportMachineǩ userCode û;userName:û connstr:ݿӴ; titileڱǩ +// fast report ֵǩrecid ¼ 1 +function showRmfLableForm(userCode:string;userName:string;connStr:string;title:string):integer; +type + TMyFunc = function(App: Tapplication; FormH: hwnd; FormID: integer; Language: integer; WinStyle: integer; GCode: Pchar; GName: Pchar; DataBase: Pchar; Title: PChar; Parameters1: PChar; Parameters2: PChar; Parameters3: PChar; Parameters4: PChar; Parameters5: PChar; Parameters6: PChar; Parameters7: PChar; Parameters8: PChar; Parameters9: PChar; Parameters10: PChar; DataBaseStr: PChar): hwnd; stdcall; +var + Tf: TMyFunc; + Tp: TFarProc; + Th: Thandle; +begin + result:=0; + Th := LoadLibrary('labelDesign.dll'); + if Th > 0 then + begin + try + Tp := GetProcAddress(Th, 'GetDllForm'); + if Tp <> nil then + begin + Tf := TMyFunc(Tp); + result := Tf(Application, 0, 1, 0, 0, PChar(userCode), PChar(userName), PChar(''), PChar(title), PChar(''), PChar(''), '', '', '', '', '', '', '', '', PChar(connStr)); + end + else + begin + ShowMessage('ӡִд'); + end; + finally + + end; + end + else + begin + ShowMessage('ҲlabelDesign.dll' ); + end; + +end; + +//ʾfr3ǩ userCode û;userName:û connstr:ݿӴ; titileڱǩ +// fast report ֵǩrecid ¼ 10 +function showFr3LableForm(userCode:string;userName:string;connStr:string;title:string):integer; +type + TMyFunc = function(App: Tapplication; FormH: hwnd; FormID: integer; Language: integer; WinStyle: integer; GCode: Pchar; GName: Pchar; DataBase: Pchar; Title: PChar; Parameters1: PChar; Parameters2: PChar; Parameters3: PChar; Parameters4: PChar; Parameters5: PChar; Parameters6: PChar; Parameters7: PChar; Parameters8: PChar; Parameters9: PChar; Parameters10: PChar; DataBaseStr: PChar): hwnd; stdcall; +var + Tf: TMyFunc; + Tp: TFarProc; + Th: Thandle; +begin + result:=0; + Th := LoadLibrary('labelDesign.dll'); + if Th > 0 then + begin + try + Tp := GetProcAddress(Th, 'GetDllForm'); + if Tp <> nil then + begin + Tf := TMyFunc(Tp); + result := Tf(Application, 0, 10, 0, 0, PChar(userCode), PChar(userName), PChar(''), PChar(title), PChar(''), PChar(''), '', '', '', '', '', '', '', '', pchar(connStr)); + end + else + begin + ShowMessage('ӡִд'); + end; + finally + + end; + end + else + begin + ShowMessage('ҲlabelDesign.dll' ); + end; + +end; + +end.