icmpp.dpr

来自「使用delphi编写的cmpp接口程序源代码」· DPR 代码 · 共 73 行

DPR
73
字号
library iCMPP;

{ 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
  ExceptionLog,
  SysUtils,
  Classes,
  UtCMPPMsg in 'UtCMPPMsg.pas',
  md5 in 'md5.pas',
  UtCMPPCom in 'UtCMPPCom.pas',
  dmParam in 'dmParam.pas';

{$R *.res}
const

  DLL_PROCESS_DETACH                    = 0;
  DLL_PROCESS_ATTACH                    = 1;
  DLL_THREAD_ATTACH                     = 2;
  DLL_THREAD_DETACH                     = 3;

procedure LibraryProc(Reason: Integer);
begin
  case Reason of

    DLL_PROCESS_DETACH:
      begin
        CMPPService.Free;
        SysLog.Free;
        Param.free;
      end;
    DLL_PROCESS_ATTACH:
      begin
        Param := TdmParamConf.Create;
        SysLog := TLogInfo.Create('iCMPP');
        CMPPService := TCMPPService.Create;

      end;
    DLL_THREAD_ATTACH:
      begin

      end;
    DLL_THREAD_DETACH:
      begin

      end;
  end;

end;

exports
  CMPPLogin,
  CMPPLoginOut,
  CMPPSendSingle,
  CMPPDeliver;

begin

  DllProc := @LibraryProc;

  DllProc(DLL_PROCESS_ATTACH);

end.

⌨️ 快捷键说明

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