⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rentdll.dpr

📁 用delphi编写的数据库管理软件
💻 DPR
字号:
library RentDLL;

{ 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
  sharemem,
  SysUtils,
  Windows,
  forms,
  Sconnect,
  Classes,
  DBClient,
  Base in '..\PublicDll\Base.pas' {frmBase},
  Base_Dll in '..\PublicDll\Base_Dll.pas' {frmBase_DLL},
  BaseHandleSearch in '..\PublicDll\BaseHandleSearch.pas' {frmHandleSearch},
  Global in '..\PublicDll\Global.pas',
  DataProcess in '..\PublicDll\DataProcess.pas',
  MDIBase in '..\PublicDll\MDIBase.pas' {frmMDIBase},
  ImportBase in '..\PublicDll\ImportBase.pas' {frmImportBase},
  Bsearch in '..\PublicDll\Bsearch.pas' {frmSearch},
  Binterface in '..\PublicDll\Binterface.pas' {frminterface},
  FormPrint in '..\PublicDll\FormPrint.pas' {frmFormPrint},
  ProductQuery in '..\PublicDll\ProductQuery.pas' {frmProductQuery},
  BillBase in '..\PublicDll\BillBase.pas' {frmBillBase},
  untOrderLease in 'untOrderLease.pas' {frmOrderLease},
  untImageBrowse in '..\BaseInfoDll\untImageBrowse.pas' {frmImageBrowse},
  BillLookup in '..\PublicDll\BillLookup.pas' {frmBillLookup},
  untLookupOrderLease in 'untLookupOrderLease.pas' {frmLookupOrderLease},
  BillStatus in '..\PublicDll\BillStatus.pas' {frmbillStatus},
  untOrderLeaseState in 'untOrderLeaseState.pas' {frmOrderLeaseState},
  untvlease in 'untvlease.pas' {frmvlease},
  untCustomerSearch in '..\VipDll\untCustomerSearch.pas' {frmCustomerSearch},
  untvLeaseState in 'untvLeaseState.pas' {frmvleaseState},
  untVReturn in 'untVReturn.pas' {frmVReturn},
  BaseEdit in '..\PublicDll\BaseEdit.pas' {frmBaseEdit},
  untAddOil in 'untAddOil.pas' {frmAddOil},
  untMainTain in 'untMainTain.pas' {frmMaintain},
  untPeccancy in 'untPeccancy.pas' {frmpeccancy},
  untAcciDent in 'untAcciDent.pas' {frmAccident},
  untHantelVehicle in 'untHantelVehicle.pas' {frmHastenvihicle};

{$R *.res}

procedure LoadRentDLL(PApplication: TApplication; PForm: TForm;
          FormName:String;DB_Name:String;PCn:TSocketConnection;
          PUsercode:String;Badmin:boolean;PCDS:TclientDataset;
          ModuleID:integer;FunctionName:String;MainHandle:integer); export; stdcall;
begin
   Application:=PApplication;
   FormName := UpperCase(FormName);
   CurrentDBName:=DB_Name;
   DLLCDS:=PCDS;
   DLLUcode:=PUsercode;
   DLLSCT := PCn;
   G_Badmin:=Badmin;
   iModuleID:=ModuleID;
   sFunctionName:=FunctionName;
//   FormHandle:=MainApplicationHandle('TfrmClientMain');
   FormHandle:=MainHandle;

   if FormName='FRMORDERLEASE' then
    begin
      if not assigned(frmorderlease) then
        frmorderlease:=Tfrmorderlease.Create(pForm);
    end;

   if FormName='FRMVLEASE' then
    begin
      if not assigned(FRMVLease) then
        FRMVLease:=TFRMVLease.Create(pForm);
    end;

   if FormName='FRMVRETURN' then
    begin
      if not assigned(FRMVRETURN) then
        FRMVRETURN:=TFRMVRETURN.Create(pForm);
    end;

   if FormName='FRMADDOIL' then
    begin
      if not assigned(frmaddoil) then
        frmaddoil:=Tfrmaddoil.Create(pForm);
    end;

   if FormName='FRMMAINTAIN' then
    begin
      if not assigned(FRMMAINTAIN) then
        FRMMAINTAIN:=TFRMMAINTAIN.Create(pForm);
    end;

   if FormName='FRMPECCANCY' then
    begin
      if not assigned(frmpeccancy) then
        frmpeccancy:=Tfrmpeccancy.Create(pForm);
    end;

   if FormName='FRMACCIDENT' then
    begin
      if not assigned(frmaccident) then
        frmaccident:=Tfrmaccident.Create(pForm);
    end;

   if FormName='FRMHASTENVIHICLE' then
    begin
      if not assigned(frmhastenvihicle) then
        frmhastenvihicle:=Tfrmhastenvihicle.Create(pForm);
    end;
end;

procedure DLLUnloadProc(Reason: Integer); register;
begin
  if Reason = DLL_PROCESS_DETACH then
    begin
      if assigned(frmorderlease) then
        frmorderlease.Free;
      if assigned(frmvlease) then
        frmvlease.Free;
      if assigned(frmvReturn) then
        frmvReturn.Free;
      if assigned(frmaddoil) then
        frmaddoil.Free;
      if assigned(frmMainTain) then
        frmMainTain.Free;
      if assigned(frmPeccancy) then
        frmPeccancy.Free;
      if assigned(frmaccident) then
        frmaccident.Free;
      if assigned(frmhastenvihicle) then
        frmhastenvihicle.free;

      Application := SaveApplication;
    end;
end;

exports
   LoadRentDLL;

begin
   SaveApplication := Application;
   DllName := 'RentDLL';
   DLLProc := @DLLUnloadProc;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -