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

📄 mailieband_tlb.pas

📁 在delphi中实现windows核心编程.原书光盘代码核心编程.原书光盘代码
💻 PAS
字号:
unit MailIEBand_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 : $Revision:   1.88  $
// File generated on 2002-5-24 9:32:08 from Type Library described below.

// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
// ************************************************************************ //
// Type Lib: E:\Delphi高级编程源代码\已完成\第五章回收站、IE\IE工具栏\MailIEBand.tlb (1)
// IID\LCID: {A078612A-EA84-4115-B2C7-7AE9EDA70C1F}\0
// Helpfile:
// DepndLst:
//   (1) v2.0 stdole, (D:\WINDOWS\SYSTEM\stdole2.tlb)
//   (2) v4.0 StdVCL, (D:\WINDOWS\SYSTEM\STDVCL40.DLL)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
interface

uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;

// *********************************************************************//
// 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
  MailIEBandMajorVersion = 1;
  MailIEBandMinorVersion = 0;

  LIBID_MailIEBand: TGUID = '{A078612A-EA84-4115-B2C7-7AE9EDA70C1F}';

  IID_IGetMailBand: TGUID = '{B6D2A030-3025-42C7-8A3A-E697D1CE8E64}';
  CLASS_GetMailBand: TGUID = '{C6872852-2478-4417-A4A0-BCB483B9B710}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
  IGetMailBand = interface;

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


// *********************************************************************//
// Interface: IGetMailBand
// Flags:     (256) OleAutomation
// GUID:      {B6D2A030-3025-42C7-8A3A-E697D1CE8E64}
// *********************************************************************//
  IGetMailBand = interface(IUnknown)
    ['{B6D2A030-3025-42C7-8A3A-E697D1CE8E64}']
  end;

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


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object    : TGetMailBand
// Help String      : GetMailBand Object
// Default Interface: IGetMailBand
// Def. Intf. DISP? : No
// Event   Interface:
// TypeFlags        : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  TGetMailBandProperties = class;
{$ENDIF}
  TGetMailBand = class(TOleServer)
  private
    FIntf: IGetMailBand;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    FProps: TGetMailBandProperties;
    function GetServerProperties: TGetMailBandProperties;
{$ENDIF}
    function GetDefaultInterface: IGetMailBand;
  protected
    procedure InitServerData; override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure Connect; override;
    procedure ConnectTo(svrIntf: IGetMailBand);
    procedure Disconnect; override;
    property DefaultInterface: IGetMailBand read GetDefaultInterface;
  published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    property Server: TGetMailBandProperties read GetServerProperties;
{$ENDIF}
  end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object    : TGetMailBand
// (This object is used by the IDE's Property Inspector to allow editing
//  of the properties of this server)
// *********************************************************************//
  TGetMailBandProperties = class(TPersistent)
  private
    FServer: TGetMailBand;
    function GetDefaultInterface: IGetMailBand;
    constructor Create(AServer: TGetMailBand);
  protected
  public
    property DefaultInterface: IGetMailBand read GetDefaultInterface;
  published
  end;
{$ENDIF}


procedure Register;

implementation

uses ComObj;

class function CoGetMailBand.Create: IGetMailBand;
begin
  Result := CreateComObject(CLASS_GetMailBand) as IGetMailBand;
end;

class function CoGetMailBand.CreateRemote(const MachineName: string): IGetMailBand;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_GetMailBand) as IGetMailBand;
end;

procedure TGetMailBand.InitServerData;
const
  CServerData: TServerData = (
    ClassID: '{C6872852-2478-4417-A4A0-BCB483B9B710}';
    IntfIID: '{B6D2A030-3025-42C7-8A3A-E697D1CE8E64}';
    EventIID: '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

procedure TGetMailBand.Connect;
var
  punk: IUnknown;
begin
  if FIntf = nil then
  begin
    punk := GetServer;
    Fintf := punk as IGetMailBand;
  end;
end;

procedure TGetMailBand.ConnectTo(svrIntf: IGetMailBand);
begin
  Disconnect;
  FIntf := svrIntf;
end;

procedure TGetMailBand.DisConnect;
begin
  if Fintf <> nil then
  begin
    FIntf := nil;
  end;
end;

function TGetMailBand.GetDefaultInterface: IGetMailBand;
begin
  if FIntf = nil then
    Connect;
  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  Result := FIntf;
end;

constructor TGetMailBand.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TGetMailBandProperties.Create(Self);
{$ENDIF}
end;

destructor TGetMailBand.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps.Free;
{$ENDIF}
  inherited Destroy;
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

function TGetMailBand.GetServerProperties: TGetMailBandProperties;
begin
  Result := FProps;
end;
{$ENDIF}

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

constructor TGetMailBandProperties.Create(AServer: TGetMailBand);
begin
  inherited Create;
  FServer := AServer;
end;

function TGetMailBandProperties.GetDefaultInterface: IGetMailBand;
begin
  Result := FServer.DefaultInterface;
end;

{$ENDIF}

procedure Register;
begin
  RegisterComponents('Servers', [TGetMailBand]);
end;

end.

⌨️ 快捷键说明

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