?? unitdllcall.pas
字號:
unit UnitDLLCall;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, UnitMainForm;
function IsReportDesignerExists:Boolean; stdcall;
function CreateReportDesigner(AMsgHandle:THandle):HWND; stdcall;
function SetReportDesignerParent(aParent:HWND):Boolean; stdcall;
function ShowReportDesigner:Boolean; stdcall;
function HideReportDesigner:Boolean; stdcall;
function ReportDesignerReAlign:Boolean; stdcall;
function DestroyReportDesigner:Boolean; stdcall;
function ConnectToDataBase(pServer, pDataBase, pUser, pPassword:PChar):Boolean; stdcall;
function SendSQLText(pSQL:PChar):Boolean; stdcall;
function SetOwnerSQL(bOwner:Boolean):Boolean; stdcall;
implementation
uses
ComObj, ActiveX, UnitProject, UnitDMLinks, UnitMainLinkObjects,
UnitEagleEye, UnitNavigation, Menus;
function IsReportDesignerExists:Boolean;
begin
Result:=Form_Main<>nil;
end;
function CreateReportDesigner(AMsgHandle:THandle):HWND;
begin
//--------------------------------------------------------------------------//
//取消遠東模式//
SysLocale.FarEast:=False;
//--------------------------------------------------------------------------//
OleInitialize(nil);
CoInitialize(nil);
//--------------------------------------------------------------------------//
CallerHandle:=AMsgHandle;
AppType:=atDLL;
AppPath:=ForceCreateWebMapPath;
//--------------------------------------------------------------------------//
if Form_Main=nil then
begin
Form_Main:=TForm_Main.Create(nil);
Form_Main.BorderStyle:=bsNone;
end;
if dm_Links=nil then
dm_Links:=Tdm_Links.Create(nil);
if dm_MainLinkObjects=nil then
dm_MainLinkObjects:=Tdm_MainLinkObjects.Create(nil);
if FrmEagleEye=nil then
FrmEagleEye:=TFrmEagleEye.Create(nil);
if FrmNavigation=nil then
FrmNavigation:=TFrmNavigation.Create(nil);
//--------------------------------------------------------------------------//
Result:=Form_Main.Handle;
//--------------------------------------------------------------------------//
end;
function SetReportDesignerParent(aParent:HWND):Boolean;
begin
Result:=IsReportDesignerExists;
if Result then
Form_Main.ParentWindow:=aParent;
end;
function ShowReportDesigner:Boolean;
begin
Result:=IsReportDesignerExists;
if Result then
Form_Main.Show;
end;
function HideReportDesigner:Boolean;
begin
Result:=IsReportDesignerExists;
if Result then
Form_Main.Hide;
end;
function ReportDesignerReAlign:Boolean;
var
ARect:TRect;
begin
Result:=IsReportDesignerExists;
if Result then
with Form_Main do
begin
if ParentWindow<>0 then
begin
Windows.GetClientRect(ParentWindow, ARect);
Left:=ARect.Left;
Top:=ARect.Top;
Width:=ARect.Right-ARect.Left;
Height:=ARect.Bottom-ARect.Top;
Refresh;
end;
end;
end;
function DestroyReportDesigner:Boolean;
begin
Result:=False;
if Form_Main=nil then Exit;
OleUninitialize;
CoUninitialize;
if FrmEagleEye<>nil then
begin
FreeAndNil(FrmEagleEye);
FrmEagleEye:=nil;
end;
if FrmNavigation<>nil then
begin
FreeAndNil(FrmNavigation);
FrmNavigation:=nil;
end;
if Form_Main<>nil then
begin
FreeAndNil(Form_Main);
Form_Main:=nil;
end;
if dm_MainLinkObjects<>nil then
begin
dm_MainLinkObjects.Free;
dm_MainLinkObjects:=nil;
end;
if dm_Links<>nil then
begin
dm_Links.Free;
dm_Links:=nil;
end;
Result:=True;
end;
function ConnectToDataBase(pServer, pDataBase, pUser, pPassword:PChar):Boolean;
begin
Result:=False;
end;
function SendSQLText(pSQL:PChar):Boolean;
begin
Result:=False;
end;
function SetOwnerSQL(bOwner:Boolean):Boolean;
begin
Result:=False;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -