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

📄 baseinfodll.dpr

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

{ 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},
  Global in '..\PublicDll\Global.pas',
  DataProcess in '..\PublicDll\DataProcess.pas',
  MDIBase in '..\PublicDll\MDIBase.pas' {frmMDIBase},
  Binterface in '..\PublicDll\Binterface.pas' {frminterface},
  Bsearch in '..\PublicDll\Bsearch.pas' {frmSearch},
  BaseInfo in '..\PublicDll\BaseInfo.pas' {frmBaseinfo},
  untUnit in 'untUnit.pas' {frmunit},
  BaseInfo_M in '..\PublicDll\BaseInfo_M.pas' {frmBaseInfo_M},
  untUnit_M in 'untUnit_M.pas' {frmUnit_M},
  untEmployee in 'untEmployee.pas' {frmemployee},
  untDept in 'untDept.pas' {frmdept},
  untDept_M in 'untDept_M.pas' {frmDept_M},
  untEmployee_m in 'untEmployee_m.pas' {frmemployee_M},
  untCustomer in 'untCustomer.pas' {frmcustomer},
  untRentType in 'untRentType.pas' {frmRentType},
  untRentType_M in 'untRentType_M.pas' {frmRentType_M},
  untCustomer_M in 'untCustomer_M.pas' {frmCustomer_M},
  Base_T in '..\PublicDll\Base_T.pas' {frmMDIBase_T},
  untArea in 'untArea.pas' {frmArea},
  untWareHouse in 'untWareHouse.pas' {frmWareHouse},
  untProvider in 'untProvider.pas' {frmProvider},
  untProvider_M in 'untProvider_M.pas' {frmProvider_M},
  untProviderType in 'untProviderType.pas' {frmProviderType},
  untProviderType_M in 'untProviderType_M.pas' {frmProviderType_M},
  untReceiptType in 'untReceiptType.pas' {frmReceiptType},
  untReceiptType_M in 'untReceiptType_M.pas' {frmReceiptType_M},
  untSafeType in 'untSafeType.pas' {frmSafeType},
  untSafeType_M in 'untSafeType_M.pas' {frmSafeType_M},
  untVehicle in 'untVehicle.pas' {frmVehicle},
  untVehicle_M in 'untVehicle_M.pas' {frmVehicle_M},
  untImageBrowse in 'untImageBrowse.pas' {frmImageBrowse},
  untCash in 'untCash.pas' {frmCash},
  untCash_M in 'untCash_M.pas' {frmCash_M},
  untReceiptPayType in 'untReceiptPayType.pas' {frmReceiptPayType},
  untReceiptPayType_M in 'untReceiptPayType_M.pas' {frmReceiptPayType_M};

{$R *.res}

procedure LoadBaseinfoDLL(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='FRMUNIT' then
   begin
     if not Assigned(frmunit) then
       frmunit := Tfrmunit.Create(PForm);
   end;

   if FormName='FRMEMPLOYEE' then
   begin
     if not Assigned(frmemployee) then
       frmemployee := Tfrmemployee.Create(PForm);
   end;

   if FormName='FRMDEPT' then
   begin
     if not Assigned(frmdept) then
       frmdept := Tfrmdept.Create(PForm);
   end;

   if FormName='FRMCUSTOMER' then
   begin
     if not Assigned(frmcustomer) then
       frmCustomer := TfrmCustomer.Create(PForm);
   end;

   if FormName='FRMRENTTYPE' then
   begin
     if not Assigned(frmrenttype) then
       frmrenttype := Tfrmrenttype.Create(PForm);
   end;

   if FormName='FRMAREA' then
   begin
     if not Assigned(frmarea) then
       frmarea := Tfrmarea.Create(PForm);
   end;

   if FormName='FRMWAREHOUSE' then
   begin
     if not Assigned(frmwarehouse) then
       frmwarehouse := Tfrmwarehouse.Create(PForm);
   end;

   if FormName='FRMPROVIDER' then
   begin
     if not Assigned(frmprovider) then
       frmprovider := Tfrmprovider.Create(PForm);
   end;

   if FormName='FRMPROVIDERTYPE' then
   begin
     if not Assigned(frmprovidertype) then
       frmprovidertype := Tfrmprovidertype.Create(PForm);
   end;

   if FormName='FRMRECEIPTTYPE' then
   begin
     if not Assigned(frmreceiptType) then
       frmreceiptType := TfrmreceiptType.Create(PForm);
   end;

   if FormName='FRMSAFETYPE' then
   begin
     if not Assigned(frmsafetype) then
       frmsafetype := Tfrmsafetype.Create(PForm);
   end;

   if FormName='FRMVEHICLE' then
   begin
     if not Assigned(frmvehicle) then
       frmvehicle := Tfrmvehicle.Create(PForm);
   end;

   if FormName='FRMCASH' then
   begin
     if not Assigned(frmcash) then
       frmcash := Tfrmcash.Create(PForm);
   end;

   if FormName='FRMRECEIPTPAYTYPE' then
   begin
     if not Assigned(frmReceiptPayType) then
       frmReceiptPayType := TfrmReceiptPayType.Create(PForm);
   end;
end;

procedure DLLUnloadProc(Reason: Integer); register;
begin
  if Reason = DLL_PROCESS_DETACH then
  begin
    if assigned(frmunit) then
      frmunit.Free;
    if assigned(frmemployee) then
      frmemployee.Free;
    if assigned(frmdept) then
      frmdept.Free;
    if assigned(frmrenttype) then
      frmrenttype.Free;
    if assigned(frmcustomer) then
      frmCustomer.Free;
    if assigned(frmarea) then
      frmarea.Free;
    if assigned(frmwarehouse) then
      frmwarehouse.Free;
    if assigned(frmprovider) then
      frmprovider.Free;
    if Assigned(frmprovidertype) then
      frmProviderType.Free;       
    if assigned(frmreceipttype) then
      frmreceipttype.Free;
    if assigned(frmsafetype) then
      frmsafetype.Free;
    if assigned(frmvehicle) then
      frmvehicle.Free;
    if assigned(frmcash) then
      frmcash.Free;
    if assigned(frmReceiptPayType) then
      frmReceiptPayType.Free;   
    Application := SaveApplication;
  end;
end;

exports
   LoadBaseinfoDLL;

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

⌨️ 快捷键说明

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