Help me start (Import .NET assembly...)

Giganews Newsgroups
Subject:Help me start (Import .NET assembly...)
Posted by: ioan ghip (than…@but-no-thanks.com)
Date:Fri, 20 Nov 2009

Hi,
In one of my projects I have to use some API made by another company.
They provided us with an ActiveX, after importing it in Delphi, I got
this. Please point me in the right direction on how to access the
function AckCDRs for example. I have no idea where to start. Here is the
  unit generated by Delphi (very long, if I can't pot it here, I'll put
it in Attachments with the same name).

TIA.
-ioan

unit XMLCOM_TLB;

{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
{$ALIGN 4}
interface

uses Windows, ActiveX, Classes, Graphics, mscorlib_TLB, OleServer,
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
  XMLCOMMajorVersion = 1;
  XMLCOMMinorVersion = 0;

  LIBID_XMLCOM: TGUID = '{F7D50F9C-1FE6-423D-BD4D-95841FED4E7E}';

  IID__FaxBack_XMLCOM_XMLCOM: TGUID =
'{E7B8884D-A890-3BED-95E7-9CC73E463F31}';
  IID_IPFSPortSrv_API: TGUID = '{665ACDD3-801E-3765-9EC5-C15303A76F75}';
  IID_IPFSConSrv_API: TGUID = '{A76C1925-6FB1-3E96-8F9C-F872584C5706}';
  IID_CAS_API: TGUID = '{577E8A08-9591-33BC-B9C5-D7418A662E24}';
  CLASS_FaxBack_XMLCOM_ActiveX_XMLCOM: TGUID =
'{E83CA07E-4425-3CB2-83E0-8CE9B6C7F7E6}';
  IID__XmlHttpClient: TGUID = '{48689DEE-7B6C-3D50-97A4-86FFE73A5D9B}';
  IID__IPFSConSrv_Names: TGUID = '{E7EBD55F-AE1B-3022-AC8C-9CDAADC33518}';
  CLASS_FaxBack_XMLCOM_XMLCOM: TGUID =
'{6F44D927-8C4B-3AA2-A38E-8755A06794C9}';
  CLASS_XmlHttpClient: TGUID = '{81D5D3C3-C889-3230-BABF-911D76CB3FA9}';
  CLASS_IPFSConSrv_Names: TGUID = '{D6388CF2-A911-3C19-A60C-733CCA71A41A}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
  _FaxBack_XMLCOM_XMLCOM = interface;
  _FaxBack_XMLCOM_XMLCOMDisp = dispinterface;
  IPFSPortSrv_API = interface;
  IPFSPortSrv_APIDisp = dispinterface;
  IPFSConSrv_API = interface;
  IPFSConSrv_APIDisp = dispinterface;
  CAS_API = interface;
  CAS_APIDisp = dispinterface;
  _XmlHttpClient = interface;
  _XmlHttpClientDisp = dispinterface;
  _IPFSConSrv_Names = interface;
  _IPFSConSrv_NamesDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
  FaxBack_XMLCOM_ActiveX_XMLCOM = _Object;
  FaxBack_XMLCOM_XMLCOM = _FaxBack_XMLCOM_XMLCOM;
  XmlHttpClient = _XmlHttpClient;
  IPFSConSrv_Names = _IPFSConSrv_Names;

// *********************************************************************//
// Interface: _FaxBack_XMLCOM_XMLCOM
// Flags:    (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {E7B8884D-A890-3BED-95E7-9CC73E463F31}
// *********************************************************************//
  _FaxBack_XMLCOM_XMLCOM = interface(IDispatch)
    ['{E7B8884D-A890-3BED-95E7-9CC73E463F31}']
  end;

// *********************************************************************//
// DispIntf:  _FaxBack_XMLCOM_XMLCOMDisp
// Flags:    (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {E7B8884D-A890-3BED-95E7-9CC73E463F31}
// *********************************************************************//
  _FaxBack_XMLCOM_XMLCOMDisp = dispinterface
    ['{E7B8884D-A890-3BED-95E7-9CC73E463F31}']
  end;

// *********************************************************************//
// Interface: IPFSPortSrv_API
// Flags:    (4416) Dual OleAutomation Dispatchable
// GUID:      {665ACDD3-801E-3765-9EC5-C15303A76F75}
// *********************************************************************//
  IPFSPortSrv_API = interface(IDispatch)
    ['{665ACDD3-801E-3765-9EC5-C15303A76F75}']
  end;

// *********************************************************************//
// DispIntf:  IPFSPortSrv_APIDisp
// Flags:    (4416) Dual OleAutomation Dispatchable
// GUID:      {665ACDD3-801E-3765-9EC5-C15303A76F75}
// *********************************************************************//
  IPFSPortSrv_APIDisp = dispinterface
    ['{665ACDD3-801E-3765-9EC5-C15303A76F75}']
  end;

// *********************************************************************//
// Interface: IPFSConSrv_API
// Flags:    (4416) Dual OleAutomation Dispatchable
// GUID:      {A76C1925-6FB1-3E96-8F9C-F872584C5706}
// *********************************************************************//
  IPFSConSrv_API = interface(IDispatch)
    ['{A76C1925-6FB1-3E96-8F9C-F872584C5706}']
    function AckCDRs(const xmlRequest: IUnknown): IUnknown; safecall;
    function CreateAccount(const xmlRequest: IUnknown): IUnknown; safecall;
    function CreateRcvRouter(const xmlRequest: IUnknown): IUnknown;
safecall;
    function DelCDRs(const xmlRequest: IUnknown): IUnknown; safecall;
    function DeleteAccount(const xmlRequest: IUnknown): IUnknown; safecall;
    function DeleteRcvRouter(const xmlRequest: IUnknown): IUnknown;
safecall;
    function GetAccounts(const xmlRequest: IUnknown): IUnknown; safecall;
    function GetCDRs(const xmlRequest: IUnknown): IUnknown; safecall;
    function GetRcvRouters(const xmlRequest: IUnknown): IUnknown; safecall;
    function GetStats(const xmlRequest: IUnknown): IUnknown; safecall;
    function ModifyAccount(const xmlRequest: IUnknown): IUnknown; safecall;
    function ModifyRcvRouter(const xmlRequest: IUnknown): IUnknown;
safecall;
  end;

// *********************************************************************//
// DispIntf:  IPFSConSrv_APIDisp
// Flags:    (4416) Dual OleAutomation Dispatchable
// GUID:      {A76C1925-6FB1-3E96-8F9C-F872584C5706}
// *********************************************************************//
  IPFSConSrv_APIDisp = dispinterface
    ['{A76C1925-6FB1-3E96-8F9C-F872584C5706}']
    function AckCDRs(const xmlRequest: IUnknown): IUnknown; dispid
1610743808;
    function CreateAccount(const xmlRequest: IUnknown): IUnknown;
dispid 1610743809;
    function CreateRcvRouter(const xmlRequest: IUnknown): IUnknown;
dispid 1610743810;
    function DelCDRs(const xmlRequest: IUnknown): IUnknown; dispid
1610743811;
    function DeleteAccount(const xmlRequest: IUnknown): IUnknown;
dispid 1610743812;
    function DeleteRcvRouter(const xmlRequest: IUnknown): IUnknown;
dispid 1610743813;
    function GetAccounts(const xmlRequest: IUnknown): IUnknown; dispid
1610743814;
    function GetCDRs(const xmlRequest: IUnknown): IUnknown; dispid
1610743815;
    function GetRcvRouters(const xmlRequest: IUnknown): IUnknown;
dispid 1610743816;
    function GetStats(const xmlRequest: IUnknown): IUnknown; dispid
1610743817;
    function ModifyAccount(const xmlRequest: IUnknown): IUnknown;
dispid 1610743818;
    function ModifyRcvRouter(const xmlRequest: IUnknown): IUnknown;
dispid 1610743819;
  end;

// *********************************************************************//
// Interface: CAS_API
// Flags:    (4416) Dual OleAutomation Dispatchable
// GUID:      {577E8A08-9591-33BC-B9C5-D7418A662E24}
// *********************************************************************//
  CAS_API = interface(IDispatch)
    ['{577E8A08-9591-33BC-B9C5-D7418A662E24}']
  end;

// *********************************************************************//
// DispIntf:  CAS_APIDisp
// Flags:    (4416) Dual OleAutomation Dispatchable
// GUID:      {577E8A08-9591-33BC-B9C5-D7418A662E24}
// *********************************************************************//
  CAS_APIDisp = dispinterface
    ['{577E8A08-9591-33BC-B9C5-D7418A662E24}']
  end;

// *********************************************************************//
// Interface: _XmlHttpClient
// Flags:    (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {48689DEE-7B6C-3D50-97A4-86FFE73A5D9B}
// *********************************************************************//
  _XmlHttpClient = interface(IDispatch)
    ['{48689DEE-7B6C-3D50-97A4-86FFE73A5D9B}']
  end;

// *********************************************************************//
// DispIntf:  _XmlHttpClientDisp
// Flags:    (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {48689DEE-7B6C-3D50-97A4-86FFE73A5D9B}
// *********************************************************************//
  _XmlHttpClientDisp = dispinterface
    ['{48689DEE-7B6C-3D50-97A4-86FFE73A5D9B}']
  end;

// *********************************************************************//
// Interface: _IPFSConSrv_Names
// Flags:    (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {E7EBD55F-AE1B-3022-AC8C-9CDAADC33518}
// *********************************************************************//
  _IPFSConSrv_Names = interface(IDispatch)
    ['{E7EBD55F-AE1B-3022-AC8C-9CDAADC33518}']
  end;

// *********************************************************************//
// DispIntf:  _IPFSConSrv_NamesDisp
// Flags:    (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {E7EBD55F-AE1B-3022-AC8C-9CDAADC33518}
// *********************************************************************//
  _IPFSConSrv_NamesDisp = dispinterface
    ['{E7EBD55F-AE1B-3022-AC8C-9CDAADC33518}']
  end;

// *********************************************************************//
// The Class CoFaxBack_XMLCOM_ActiveX_XMLCOM provides a Create and
CreateRemote method to
// create instances of the default interface _Object exposed by

// the CoClass FaxBack_XMLCOM_ActiveX_XMLCOM. The functions are intended
to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
  CoFaxBack_XMLCOM_ActiveX_XMLCOM = class
    class function Create: _Object;
    class function CreateRemote(const MachineName: string): _Object;
  end;

// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object    : TFaxBack_XMLCOM_ActiveX_XMLCOM
// Help String      :
// Default Interface: _Object
// Def. Intf. DISP? : No
// Event  Interface:
// TypeFlags        : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  TFaxBack_XMLCOM_ActiveX_XMLCOMProperties= class;
{$ENDIF}
  TFaxBack_XMLCOM_ActiveX_XMLCOM = class(TOleServer)
  private
    FIntf: _Object;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    FProps: TFaxBack_XMLCOM_ActiveX_XMLCOMProperties;
    function GetServerProperties: TFaxBack_XMLCOM_ActiveX_XMLCOMProperties;
{$ENDIF}
    function GetDefaultInterface: _Object;
  protected
    procedure InitServerData; override;
    function Get_ToString: WideString;
  public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;
    procedure Connect; override;
    procedure ConnectTo(svrIntf: _Object);
    procedure Disconnect; override;
    function Equals(obj: OleVariant): WordBool;
    function GetHashCode: Integer;
    function GetType: _Type;
    property DefaultInterface: _Object read GetDefaultInterface;
    property ToString: WideString read Get_ToString;
  published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    property Server: TFaxBack_XMLCOM_ActiveX_XMLCOMProperties read
GetServerProperties;
{$ENDIF}
  end;

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

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

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

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

// *********************************************************************//
// The Class CoXmlHttpClient provides a Create and CreateRemote method
to
// create instances of the default interface _XmlHttpClient exposed by

// the CoClass XmlHttpClient. The functions are intended to be used by

// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
  CoXmlHttpClient = class
    class function Create: _XmlHttpClient;
    class function CreateRemote(const MachineName: string): _XmlHttpClient;
  end;

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

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

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

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

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

procedure Register;

resourcestring
  dtlServerPage = 'ActiveX';

  dtlOcxPage = 'ActiveX';

implementation

uses ComObj;

class function CoFaxBack_XMLCOM_ActiveX_XMLCOM.Create: _Object;
begin
  Result := CreateComObject(CLASS_FaxBack_XMLCOM_ActiveX_XMLCOM) as
_Object;
end;

class function CoFaxBack_XMLCOM_ActiveX_XMLCOM.CreateRemote(const
MachineName: string): _Object;
begin
  Result := CreateRemoteComObject(MachineName,
CLASS_FaxBack_XMLCOM_ActiveX_XMLCOM) as _Object;
end;

procedure TFaxBack_XMLCOM_ActiveX_XMLCOM.InitServerData;
const
  CServerData: TServerData = (
    ClassID:  '{E83CA07E-4425-3CB2-83E0-8CE9B6C7F7E6}';
    IntfIID:  '{65074F7F-63C0-304E-AF0A-D51741CB4A8D}';
    EventIID:  '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

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

procedure TFaxBack_XMLCOM_ActiveX_XMLCOM.ConnectTo(svrIntf: _Object);
begin
  Disconnect;
  FIntf := svrIntf;
end;

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

function TFaxBack_XMLCOM_ActiveX_XMLCOM.GetDefaultInterface: _Object;
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 TFaxBack_XMLCOM_ActiveX_XMLCOM.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TFaxBack_XMLCOM_ActiveX_XMLCOMProperties.Create(Self);
{$ENDIF}
end;

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

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TFaxBack_XMLCOM_ActiveX_XMLCOM.GetServerProperties:
TFaxBack_XMLCOM_ActiveX_XMLCOMProperties;
begin
  Result := FProps;
end;
{$ENDIF}

function TFaxBack_XMLCOM_ActiveX_XMLCOM.Get_ToString: WideString;
begin
    Result := DefaultInterface.ToString;
end;

function TFaxBack_XMLCOM_ActiveX_XMLCOM.Equals(obj: OleVariant): WordBool;
begin
  Result := DefaultInterface.Equals(obj);
end;

function TFaxBack_XMLCOM_ActiveX_XMLCOM.GetHashCode: Integer;
begin
  Result := DefaultInterface.GetHashCode;
end;

function TFaxBack_XMLCOM_ActiveX_XMLCOM.GetType: _Type;
begin
  Result := DefaultInterface.GetType;
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TFaxBack_XMLCOM_ActiveX_XMLCOMProperties.Create(AServer:
TFaxBack_XMLCOM_ActiveX_XMLCOM);
begin
  inherited Create;
  FServer := AServer;
end;

function TFaxBack_XMLCOM_ActiveX_XMLCOMProperties.GetDefaultInterface:
_Object;
begin
  Result := FServer.DefaultInterface;
end;

function TFaxBack_XMLCOM_ActiveX_XMLCOMProperties.Get_ToString: WideString;
begin
    Result := DefaultInterface.ToString;
end;

{$ENDIF}

class function CoFaxBack_XMLCOM_XMLCOM.Create: _FaxBack_XMLCOM_XMLCOM;
begin
  Result := CreateComObject(CLASS_FaxBack_XMLCOM_XMLCOM) as
_FaxBack_XMLCOM_XMLCOM;
end;

class function CoFaxBack_XMLCOM_XMLCOM.CreateRemote(const MachineName:
string): _FaxBack_XMLCOM_XMLCOM;
begin
  Result := CreateRemoteComObject(MachineName,
CLASS_FaxBack_XMLCOM_XMLCOM) as _FaxBack_XMLCOM_XMLCOM;
end;

procedure TFaxBack_XMLCOM_XMLCOM.InitServerData;
const
  CServerData: TServerData = (
    ClassID:  '{6F44D927-8C4B-3AA2-A38E-8755A06794C9}';
    IntfIID:  '{E7B8884D-A890-3BED-95E7-9CC73E463F31}';
    EventIID:  '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

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

procedure TFaxBack_XMLCOM_XMLCOM.ConnectTo(svrIntf: _FaxBack_XMLCOM_XMLCOM);
begin
  Disconnect;
  FIntf := svrIntf;
end;

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

function TFaxBack_XMLCOM_XMLCOM.GetDefaultInterface: _FaxBack_XMLCOM_XMLCOM;
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 TFaxBack_XMLCOM_XMLCOM.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TFaxBack_XMLCOM_XMLCOMProperties.Create(Self);
{$ENDIF}
end;

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

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TFaxBack_XMLCOM_XMLCOM.GetServerProperties:
TFaxBack_XMLCOM_XMLCOMProperties;
begin
  Result := FProps;
end;
{$ENDIF}

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TFaxBack_XMLCOM_XMLCOMProperties.Create(AServer:
TFaxBack_XMLCOM_XMLCOM);
begin
  inherited Create;
  FServer := AServer;
end;

function TFaxBack_XMLCOM_XMLCOMProperties.GetDefaultInterface:
_FaxBack_XMLCOM_XMLCOM;
begin
  Result := FServer.DefaultInterface;
end;

{$ENDIF}

class function CoXmlHttpClient.Create: _XmlHttpClient;
begin
  Result := CreateComObject(CLASS_XmlHttpClient) as _XmlHttpClient;
end;

class function CoXmlHttpClient.CreateRemote(const MachineName: string):
_XmlHttpClient;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_XmlHttpClient) as
_XmlHttpClient;
end;

procedure TXmlHttpClient.InitServerData;
const
  CServerData: TServerData = (
    ClassID:  '{81D5D3C3-C889-3230-BABF-911D76CB3FA9}';
    IntfIID:  '{48689DEE-7B6C-3D50-97A4-86FFE73A5D9B}';
    EventIID:  '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

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

procedure TXmlHttpClient.ConnectTo(svrIntf: _XmlHttpClient);
begin
  Disconnect;
  FIntf := svrIntf;
end;

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

function TXmlHttpClient.GetDefaultInterface: _XmlHttpClient;
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 TXmlHttpClient.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TXmlHttpClientProperties.Create(Self);
{$ENDIF}
end;

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

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TXmlHttpClient.GetServerProperties: TXmlHttpClientProperties;
begin
  Result := FProps;
end;
{$ENDIF}

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TXmlHttpClientProperties.Create(AServer: TXmlHttpClient);
begin
  inherited Create;
  FServer := AServer;
end;

function TXmlHttpClientProperties.GetDefaultInterface: _XmlHttpClient;
begin
  Result := FServer.DefaultInterface;
end;

{$ENDIF}

class function CoIPFSConSrv_Names.Create: _IPFSConSrv_Names;
begin
  Result := CreateComObject(CLASS_IPFSConSrv_Names) as _IPFSConSrv_Names;
end;

class function CoIPFSConSrv_Names.CreateRemote(const MachineName:
string): _IPFSConSrv_Names;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_IPFSConSrv_Names)
as _IPFSConSrv_Names;
end;

procedure TIPFSConSrv_Names.InitServerData;
const
  CServerData: TServerData = (
    ClassID:  '{D6388CF2-A911-3C19-A60C-733CCA71A41A}';
    IntfIID:  '{E7EBD55F-AE1B-3022-AC8C-9CDAADC33518}';
    EventIID:  '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

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

procedure TIPFSConSrv_Names.ConnectTo(svrIntf: _IPFSConSrv_Names);
begin
  Disconnect;
  FIntf := svrIntf;
end;

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

function TIPFSConSrv_Names.GetDefaultInterface: _IPFSConSrv_Names;
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 TIPFSConSrv_Names.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TIPFSConSrv_NamesProperties.Create(Self);
{$ENDIF}
end;

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

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TIPFSConSrv_Names.GetServerProperties: TIPFSConSrv_NamesProperties;
begin
  Result := FProps;
end;
{$ENDIF}

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TIPFSConSrv_NamesProperties.Create(AServer: TIPFSConSrv_Names);
begin
  inherited Create;
  FServer := AServer;
end;

function TIPFSConSrv_NamesProperties.GetDefaultInterface: _IPFSConSrv_Names;
begin
  Result := FServer.DefaultInterface;
end;

{$ENDIF}

procedure Register;
begin
  RegisterComponents(dtlServerPage, [TFaxBack_XMLCOM_ActiveX_XMLCOM,
TFaxBack_XMLCOM_XMLCOM, TXmlHttpClient, TIPFSConSrv_Names]);
end;

end.

Replies