85 lines
2.4 KiB
ObjectPascal
85 lines
2.4 KiB
ObjectPascal
|
unit U_RPFun;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
Dialogs, ComCtrls, ToolWin, StdCtrls, BtnEdit, cxStyles, cxCustomData,
|
|||
|
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DBGrids, DB, cxDBData,
|
|||
|
cxGridLevel, cxClasses, cxControls, cxGridCustomView, ADODB, StrUtils, Midas,
|
|||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxTimeEdit,
|
|||
|
cxTreeView, cxGrid, cxDBLookupComboBox, cxCalendar, cxCurrencyEdit,
|
|||
|
cxGridExportLink, ExtCtrls, Buttons, DBClient, RTComboBox, cxDropDownEdit,
|
|||
|
cxGridBandedTableView, cxGridDBBandedTableView, cxRichEdit, cxButtonEdit,
|
|||
|
IniFiles, WinSock, IdHTTP, dxcore, cxTextEdit, FireDAC.Comp.Client, cxCheckBox,
|
|||
|
Vcl.Clipbrd, cxMemo, dxLayoutControl;
|
|||
|
|
|||
|
function FromPrintFr3(App: Tapplication; DataBaseStr: PChar; JsonArgs: PChar): PChar;
|
|||
|
|
|||
|
function FunPrintFr3(App: Tapplication; DataBaseStr: PChar; JsonArgs: PChar): PChar;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
function FromPrintFr3(App: Tapplication; DataBaseStr: PChar; JsonArgs: PChar): PChar;
|
|||
|
type
|
|||
|
TMyFunc = function(App: Tapplication; FormID: integer; Title: PChar; DataBaseStr: PChar; JsonArgs: PChar): PChar; stdcall;
|
|||
|
var
|
|||
|
Tf: TMyFunc;
|
|||
|
Tp: TFarProc;
|
|||
|
Th: Thandle;
|
|||
|
JsonResult: PChar;
|
|||
|
begin
|
|||
|
Th := LoadLibrary('ReportPrint.dll');
|
|||
|
if Th > 0 then
|
|||
|
begin
|
|||
|
Tp := GetProcAddress(Th, 'GetDllForm');
|
|||
|
if Tp <> nil then
|
|||
|
begin
|
|||
|
Tf := TMyFunc(Tp);
|
|||
|
JsonResult := Tf(Application, 11, 'FR3<52><33><EFBFBD><EFBFBD>', DataBaseStr, JsonArgs);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
JsonResult := '{"succsee":false,"message": "<22><>ȡ<EFBFBD><C8A1><EFBFBD>ú<EFBFBD><C3BA>쳣"}';
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
JsonResult := '{"succsee":false,"message": "<22>Ҳ<EFBFBD><D2B2><EFBFBD>ReportPrint.dll"}';
|
|||
|
end;
|
|||
|
Result := JsonResult;
|
|||
|
end;
|
|||
|
|
|||
|
function FunPrintFr3(App: Tapplication; DataBaseStr: PChar; JsonArgs: PChar): PChar;
|
|||
|
type
|
|||
|
TMyFunc = function(App: Tapplication; FormID: integer; Title: PChar; DataBaseStr: PChar; JsonArgs: PChar): PChar; stdcall;
|
|||
|
var
|
|||
|
Tf: TMyFunc;
|
|||
|
Tp: TFarProc;
|
|||
|
Th: Thandle;
|
|||
|
JsonResult: PChar;
|
|||
|
begin
|
|||
|
Th := LoadLibrary('ReportPrint.dll');
|
|||
|
if Th > 0 then
|
|||
|
begin
|
|||
|
Tp := GetProcAddress(Th, 'GetDllForm');
|
|||
|
if Tp <> nil then
|
|||
|
begin
|
|||
|
Tf := TMyFunc(Tp);
|
|||
|
JsonResult := Tf(Application, 12, 'FR3<52><33><EFBFBD><EFBFBD>', DataBaseStr, JsonArgs);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
JsonResult := '{"succsee":false,"message": "<22><>ȡ<EFBFBD><C8A1><EFBFBD>ú<EFBFBD><C3BA>쳣"}';
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
JsonResult := '{"succsee":false,"message": "<22>Ҳ<EFBFBD><D2B2><EFBFBD>ReportPrint.dll"}';
|
|||
|
end;
|
|||
|
Result := JsonResult;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|