unit PMyInterface_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 2003/5/26 ¤W¤È 11:57:37 from Type Library described below.

// ************************************************************************  //
// Type Lib: C:\pub\LeeWei\Books\InsideVCL\Demos\Chap06\Demo1\PMyInterface.tlb (1)
// LIBID: {0173EF2D-351A-41A1-8C31-AAF86EDAB625}
// LCID: 0
// Helpfile: 
// HelpString: PMyInterface Library
// DepndLst: 
//   (1) v2.0 stdole, (C:\WINDOWS\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
  PMyInterfaceMajorVersion = 1;
  PMyInterfaceMinorVersion = 0;

  LIBID_PMyInterface: TGUID = '{0173EF2D-351A-41A1-8C31-AAF86EDAB625}';

  IID_IMyInterface: TGUID = '{6C928605-C6C2-4EE1-8DD2-E080C96757FD}';
  CLASS_MyInterface: TGUID = '{C4784761-3D71-4EFD-B97E-384377C84F78}';
type

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

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


// *********************************************************************//
// Interface: IMyInterface
// Flags:     (256) OleAutomation
// GUID:      {6C928605-C6C2-4EE1-8DD2-E080C96757FD}
// *********************************************************************//
  IMyInterface = interface(IUnknown)
    ['{6C928605-C6C2-4EE1-8DD2-E080C96757FD}']
    function GetInterfaceAge(out iAge: Integer): HResult; stdcall;
    function GetName(out sName: WideString): HResult; stdcall;
    function GetInterfaceCount(var iCount: Integer): HResult; stdcall;
    function GetAllInterfaces(var vVariant: OleVariant): HResult; stdcall;
  end;

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

implementation

uses ComObj;

class function CoMyInterface.Create: IMyInterface;
begin
  Result := CreateComObject(CLASS_MyInterface) as IMyInterface;
end;

class function CoMyInterface.CreateRemote(const MachineName: string): IMyInterface;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_MyInterface) as IMyInterface;
end;

end.
