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

📄 log_tlb.pas

📁 一个实现程序日志功能的com组件
💻 PAS
字号:
unit Log_TLB;

// ************************************************************************ //
// WARNING                                                                    
// -------                                                                    
// The types declared in this file were generated from data read from a       
// Type Library. If this type library is explicitly or indirectly (via        
// another type library referring to this type library) re-imported, or the   
// 'Refresh' command of the Type Library Editor activated while editing the   
// Type Library, the contents of this file will be regenerated and all        
// manual modifications will be lost.                                         
// ************************************************************************ //

// PASTLWTR : 1.2
// File generated on 2006-6-2 16:36:54 from Type Library described below.

// ************************************************************************  //
// Type Lib: D:\projects\CGQ\Interface\Common\LogModule\Log.tlb (1)
// LIBID: {BF57D9C9-9172-42E5-9954-93FC8980F9A6}
// LCID: 0
// Helpfile: 
// HelpString: Log Library
// DepndLst: 
//   (1) v2.0 stdole, (C:\WINNT\system32\stdole2.tlb)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, StdVCL, Variants;
  

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:        
//   Type Libraries     : LIBID_xxxx                                      
//   CoClasses          : CLASS_xxxx                                      
//   DISPInterfaces     : DIID_xxxx                                       
//   Non-DISP interfaces: IID_xxxx                                        
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  LogMajorVersion = 1;
  LogMinorVersion = 0;

  LIBID_Log: TGUID = '{BF57D9C9-9172-42E5-9954-93FC8980F9A6}';

  IID_ILogger: TGUID = '{D23CBE84-B853-4362-B383-74531E15A41E}';
  CLASS_Logger: TGUID = '{4F457E4E-7D8F-4065-929D-D64563963B7A}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary                    
// *********************************************************************//
  ILogger = interface;
  ILoggerDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library                       
// (NOTE: Here we map each CoClass to its Default Interface)              
// *********************************************************************//
  Logger = ILogger;


// *********************************************************************//
// Interface: ILogger
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {D23CBE84-B853-4362-B383-74531E15A41E}
// *********************************************************************//
  ILogger = interface(IDispatch)
    ['{D23CBE84-B853-4362-B383-74531E15A41E}']
    function Get_FileName: WideString; safecall;
    procedure Set_FileName(const Value: WideString); safecall;
    function Get_MaxSize: Integer; safecall;
    procedure Set_MaxSize(Value: Integer); safecall;
    function Get_Enabled: WordBool; safecall;
    procedure Set_Enabled(Value: WordBool); safecall;
    procedure Log(const AInfo: WideString); safecall;
    procedure FreeResource; safecall;
    property FileName: WideString read Get_FileName write Set_FileName;
    property MaxSize: Integer read Get_MaxSize write Set_MaxSize;
    property Enabled: WordBool read Get_Enabled write Set_Enabled;
  end;

// *********************************************************************//
// DispIntf:  ILoggerDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {D23CBE84-B853-4362-B383-74531E15A41E}
// *********************************************************************//
  ILoggerDisp = dispinterface
    ['{D23CBE84-B853-4362-B383-74531E15A41E}']
    property FileName: WideString dispid 1;
    property MaxSize: Integer dispid 2;
    property Enabled: WordBool dispid 3;
    procedure Log(const AInfo: WideString); dispid 5;
    procedure FreeResource; dispid 6;
  end;

// *********************************************************************//
// The Class CoLogger provides a Create and CreateRemote method to          
// create instances of the default interface ILogger exposed by              
// the CoClass Logger. The functions are intended to be used by             
// clients wishing to automate the CoClass objects exposed by the         
// server of this typelibrary.                                            
// *********************************************************************//
  CoLogger = class
    class function Create: ILogger;
    class function CreateRemote(const MachineName: string): ILogger;
  end;

implementation

uses ComObj;

class function CoLogger.Create: ILogger;
begin
  Result := CreateComObject(CLASS_Logger) as ILogger;
end;

class function CoLogger.CreateRemote(const MachineName: string): ILogger;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_Logger) as ILogger;
end;

end.

⌨️ 快捷键说明

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