Creating Container Classes

Creating Container Classes in Delphi News / Other topic (part of our Pascal and Delphi Coding group).

Quick Search: Creating   Container   Classes   Creating Container   Creating Container Classes  
Most Recent Post
gordon
 (Inactive)
-- USA
I have an imported Type Library, and I need to write a container class for it.

The imported Type library is like this:
========================================
unit VIADAB_2Lib_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.1.0.1.0 $
// File generated on 04/07/2001 10:48:11 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: C:\Program Files\Psion\WaveFinder\Viadab_2.exe (1)
// IID\LCID: {48637D76-0E20-43E7-B6D8-B614ECA59D44}\0
// Helpfile:
// DepndLst:
// (1) v2.0 stdole, (C:\WINNT\System32\stdole2.tlb)
// (2) v4.0 StdVCL, (C:\WINNT\System32\STDVCL40.DLL)
// Errors:
// Error creating palette bitmap of (TVRxControl) : Server C:\PROGRA~1\Psion\WAVEFI~1\Viadab_2.exe contains no icons
// ************************************************************************ //
{$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
VIADAB_2LibMajorVersion = 1;
VIADAB_2LibMinorVersion = 0;

LIBID_VIADAB_2Lib: TGUID = '{48637D76-0E20-43E7-B6D8-B614ECA59D44}';

IID_IVRxControl: TGUID = '{842785BE-65E0-435F-91D7-768B755B7225}';
CLASS_VRxControl: TGUID = '{64C64A07-B76B-4352-B0FE-E18B2A84A85B}';
IID_IVRxEventSink: TGUID = '{2579AC89-0339-4B7F-85AB-4671D71EBE82}';
IID_IVPDataSink: TGUID = '{B4FA9DEF-296A-49CC-865D-FE7E4EB1E16F}';

// *********************************************************************//
// Declaration of Enumerations defined in Type Library
// *********************************************************************//
// Constants for enum VRxErrorLevel
type
VRxErrorLevel = TOleEnum;
const
RXEL_UNKNOWN = $00000000;
RXEL_WARNING = $00000001;
RXEL_ERROR = $00000002;

// Constants for enum VRxErrorCode
type
VRxErrorCode = TOleEnum;
const
RXEC_UNKNOWN = $00000000;
RXEC_NO_HARDWARE = $00000001;

// Constants for enum VRxTransportMode
type
VRxTransportMode = TOleEnum;
const
TM_DONT_KNOW = $000003E7;
TM_MSC_AUDIO_STREAM_SERVICE = $00000000;
TM_MSC_DATA_STREAM_SERVICE = $00000001;
TM_FIDC_SERVICE = $00000002;
TM_MSC_DATA_PACKET_SERVICE = $00000003;

// Constants for enum VRxProgTypeCode
type
VRxProgTypeCode = TOleEnum;
const
PTY_DONT_KNOW = $000003E7;
PTY_UNDEFINED = $00000000;
PTY_NEWS = $00000001;
PTY_CURRENT_AFFAIRS = $00000002;
PTY_INFORMATION = $00000003;
PTY_SPORT = $00000004;
PTY_EDUCATION = $00000005;
PTY_DRAMA = $00000006;
PTY_CULTURE = $00000007;
PTY_SCIENCE = $00000008;
PTY_VARIED = $00000009;
PTY_CHART = $0000000A;
PTY_ROCK = $0000000B;
PTY_EASY = $0000000C;
PTY_LIGHT_CLASSICAL = $0000000D;
PTY_CLASSICAL = $0000000E;
PTY_MUSIC = $0000000F;
PTY_WEATHER = $00000010;
PTY_FINANCE = $00000011;
PTY_CHILDRENS = $00000012;
PTY_SOCIAL_AFFAIRS = $00000013;
PTY_RELIGION = $00000014;
PTY_PHONE_IN = $00000015;
PTY_TRAVEL = $00000016;
PTY_LEISURE = $00000017;
PTY_JAZZ = $00000018;
PTY_COUNTRY = $00000019;
PTY_NATIONAL = $0000001A;
PTY_OLDIES = $0000001B;
PTY_FOLK = $0000001C;
PTY_DOCUMENTARY = $0000001D;
PTY_ALARM_TEST = $0000001E;
PTY_ALARM = $0000001F;

// Constants for enum VPDataSource
type
VPDataSource = TOleEnum;
const
VPDS_DONT_KNOW = $00000000;
VPDS_MSC = $00000001;
VPDS_FIC = $00000002;
VPDS_PAD = $00000003;

type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
IVRxControl = interface;
IVRxEventSink = interface;
IVPDataSink = interface;

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


// *********************************************************************//
// Interface: IVRxControl
// Flags: (0)
// GUID: {842785BE-65E0-435F-91D7-768B755B7225}
// *********************************************************************//
IVRxControl = interface(IUnknown)
['{842785BE-65E0-435F-91D7-768B755B7225}']
function SetEventSink(const pEventSink: IVRxEventSink; out pOk: Integer): HResult; stdcall;
function Tune(dMHz: Double; out pOk: Integer): HResult; stdcall;
function IsTuned(out pbTuned: Integer): HResult; stdcall;
function GetEnsembleId(out pEId: SYSINT): HResult; stdcall;
function GetEnsembleLabel(out pLabel: WideString): HResult; stdcall;
function GetServiceLabel(iSId: SYSINT; out pLabel: WideString): HResult; stdcall;
function GetComponentLabel(iSId: SYSINT; iSCIdS: SYSINT; out pLabel: WideString): HResult; stdcall;
function GetServiceIdArray(out pServiceIds: OleVariant): HResult; stdcall;
function GetComponentIdArray(iSId: SYSINT; out pSCIdSs: OleVariant): HResult; stdcall;
function GetUserApplicationArray(iSId: SYSINT; iSCIdS: SYSINT;
out pUserApplications: OleVariant): HResult; stdcall;
function GetUserApplicationData(iSId: SYSINT; iSCIdS: SYSINT; iUserApp: SYSINT;
out pUserApplicationData: OleVariant): HResult; stdcall;
function GetTransportMode(iSId: SYSINT; iSCIdS: SYSINT; out pTransportMode: VRxTransportMode): HResult; stdcall;
function GetProgrammeType(iSId: SYSINT; out pProgType: VRxProgTypeCode): HResult; stdcall;
function GetDynamicProgrammeType(iSId: SYSINT; out pProgType: VRxProgTypeCode): HResult; stdcall;
function GetDataServiceComponentType(iSId: SYSINT; iSCIdS: SYSINT;
out pDataComponentType: SYSINT): HResult; stdcall;
function StartPlaying(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult; stdcall;
function IsPlaying(iSId: SYSINT; iSCIdS: SYSINT; out pbIsPlaying: Integer): HResult; stdcall;
function StopPlaying(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult; stdcall;
function StartDecoding(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult; stdcall;
function StopDecoding(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult; stdcall;
function IsDecoding(iSId: SYSINT; iSCIdS: SYSINT; out pbIsDecoding: Integer): HResult; stdcall;
function GetDLS(iSId: SYSINT; iSCIdS: SYSINT; out pDLS: WideString): HResult; stdcall;
function GetFICBER(out pFICBER: Double): HResult; stdcall;
function GetDABTime(out pDate: TDateTime): HResult; stdcall;
function GetDABLocalTimeOffset(out dLTO: Double): HResult; stdcall;
function GetVolume(out dVolume: Double): HResult; stdcall;
function SetVolume(dVolume: Double): HResult; stdcall;
function GetDABInfo(const Query: WideString; out pResponse: WideString): HResult; stdcall;
function SubscribeMSC(iSId: SYSINT; iSCIdS: SYSINT; const pDataSink: IVPDataSink;
out ok: Integer): HResult; stdcall;
function SubscribePAD(iSId: SYSINT; iSCIdS: SYSINT; const pDataSink: IVPDataSink;
out ok: Integer): HResult; stdcall;
function SubscribeFIC(const pDataSink: IVPDataSink; out ok: Integer): HResult; stdcall;
function Unsubscribe(const pDataSink: IVPDataSink; out ok: Integer): HResult; stdcall;
end;

// *********************************************************************//
// Interface: IVRxEventSink
// Flags: (0)
// GUID: {2579AC89-0339-4B7F-85AB-4671D71EBE82}
// *********************************************************************//
IVRxEventSink = interface(IUnknown)
['{2579AC89-0339-4B7F-85AB-4671D71EBE82}']
function Ensemble(bEnsembleAvailable: Integer): HResult; stdcall;
function MultiplexConfiguration(bSignalled: Integer): HResult; stdcall;
function Tracking(AGC: Integer; FT: Integer; SCT: Integer; AFC: Integer; SW: Integer;
FIC: Integer): HResult; stdcall;
function Error(eLevel: VRxErrorLevel; eCode: VRxErrorCode; const strError: WideString): HResult; stdcall;
end;

// *********************************************************************//
// Interface: IVPDataSink
// Flags: (0)
// GUID: {B4FA9DEF-296A-49CC-865D-FE7E4EB1E16F}
// *********************************************************************//
IVPDataSink = interface(IUnknown)
['{B4FA9DEF-296A-49CC-865D-FE7E4EB1E16F}']
function Data(iSId: SYSINT; iSCIdS: SYSINT; vpds: VPDataSource; vData: OleVariant): HResult; stdcall;
function GetSource(out vpds: VPDataSource): HResult; stdcall;
function GetSId(out iSId: SYSINT): HResult; stdcall;
function GetSCIdS(out iSCIdS: SYSINT): HResult; stdcall;
end;

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


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TVRxControl
// Help String : VRxControl Class
// Default Interface: IVRxControl
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TVRxControlProperties= class;
{$ENDIF}
TVRxControl = class(TOleServer)
private
FIntf: IVRxControl;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TVRxControlProperties;
function GetServerProperties: TVRxControlProperties;
{$ENDIF}
function GetDefaultInterface: IVRxControl;
protected
procedure InitServerData; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IVRxControl);
procedure Disconnect; override;
function SetEventSink(const pEventSink: IVRxEventSink; out pOk: Integer): HResult;
function Tune(dMHz: Double; out pOk: Integer): HResult;
function IsTuned(out pbTuned: Integer): HResult;
function GetEnsembleId(out pEId: SYSINT): HResult;
function GetEnsembleLabel(out pLabel: WideString): HResult;
function GetServiceLabel(iSId: SYSINT; out pLabel: WideString): HResult;
function GetComponentLabel(iSId: SYSINT; iSCIdS: SYSINT; out pLabel: WideString): HResult;
function GetServiceIdArray(out pServiceIds: OleVariant): HResult;
function GetComponentIdArray(iSId: SYSINT; out pSCIdSs: OleVariant): HResult;
function GetUserApplicationArray(iSId: SYSINT; iSCIdS: SYSINT;
out pUserApplications: OleVariant): HResult;
function GetUserApplicationData(iSId: SYSINT; iSCIdS: SYSINT; iUserApp: SYSINT;
out pUserApplicationData: OleVariant): HResult;
function GetTransportMode(iSId: SYSINT; iSCIdS: SYSINT; out pTransportMode: VRxTransportMode): HResult;
function GetProgrammeType(iSId: SYSINT; out pProgType: VRxProgTypeCode): HResult;
function GetDynamicProgrammeType(iSId: SYSINT; out pProgType: VRxProgTypeCode): HResult;
function GetDataServiceComponentType(iSId: SYSINT; iSCIdS: SYSINT;
out pDataComponentType: SYSINT): HResult;
function StartPlaying(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult;
function IsPlaying(iSId: SYSINT; iSCIdS: SYSINT; out pbIsPlaying: Integer): HResult;
function StopPlaying(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult;
function StartDecoding(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult;
function StopDecoding(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult;
function IsDecoding(iSId: SYSINT; iSCIdS: SYSINT; out pbIsDecoding: Integer): HResult;
function GetDLS(iSId: SYSINT; iSCIdS: SYSINT; out pDLS: WideString): HResult;
function GetFICBER(out pFICBER: Double): HResult;
function GetDABTime(out pDate: TDateTime): HResult;
function GetDABLocalTimeOffset(out dLTO: Double): HResult;
function GetVolume(out dVolume: Double): HResult;
function SetVolume(dVolume: Double): HResult;
function GetDABInfo(const Query: WideString; out pResponse: WideString): HResult;
function SubscribeMSC(iSId: SYSINT; iSCIdS: SYSINT; const pDataSink: IVPDataSink;
out ok: Integer): HResult;
function SubscribePAD(iSId: SYSINT; iSCIdS: SYSINT; const pDataSink: IVPDataSink;
out ok: Integer): HResult;
function SubscribeFIC(const pDataSink: IVPDataSink; out ok: Integer): HResult;
function Unsubscribe(const pDataSink: IVPDataSink; out ok: Integer): HResult;
property DefaultInterface: IVRxControl read GetDefaultInterface;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TVRxControlProperties read GetServerProperties;
{$ENDIF}
end;

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


procedure Register;

implementation

uses ComObj;

class function CoVRxControl.Create: IVRxControl;
begin
Result := CreateComObject(CLASS_VRxControl) as IVRxControl;
end;

class function CoVRxControl.CreateRemote(const MachineName: string): IVRxControl;
begin
Result := CreateRemoteComObject(MachineName, CLASS_VRxControl) as IVRxControl;
end;

procedure TVRxControl.InitServerData;
const
CServerData: TServerData = (
ClassID: '{64C64A07-B76B-4352-B0FE-E18B2A84A85B}';
IntfIID: '{842785BE-65E0-435F-91D7-768B755B7225}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;

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

procedure TVRxControl.ConnectTo(svrIntf: IVRxControl);
begin
Disconnect;
FIntf := svrIntf;
end;

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

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

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

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

function TVRxControl.SetEventSink(const pEventSink: IVRxEventSink; out pOk: Integer): HResult;
begin
Result := DefaultInterface.SetEventSink(pEventSink, pOk);
end;

function TVRxControl.Tune(dMHz: Double; out pOk: Integer): HResult;
begin
Result := DefaultInterface.Tune(dMHz, pOk);
end;

function TVRxControl.IsTuned(out pbTuned: Integer): HResult;
begin
Result := DefaultInterface.IsTuned(pbTuned);
end;

function TVRxControl.GetEnsembleId(out pEId: SYSINT): HResult;
begin
Result := DefaultInterface.GetEnsembleId(pEId);
end;

function TVRxControl.GetEnsembleLabel(out pLabel: WideString): HResult;
begin
Result := DefaultInterface.GetEnsembleLabel(pLabel);
end;

function TVRxControl.GetServiceLabel(iSId: SYSINT; out pLabel: WideString): HResult;
begin
Result := DefaultInterface.GetServiceLabel(iSId, pLabel);
end;

function TVRxControl.GetComponentLabel(iSId: SYSINT; iSCIdS: SYSINT; out pLabel: WideString): HResult;
begin
Result := DefaultInterface.GetComponentLabel(iSId, iSCIdS, pLabel);
end;

function TVRxControl.GetServiceIdArray(out pServiceIds: OleVariant): HResult;
begin
Result := DefaultInterface.GetServiceIdArray(pServiceIds);
end;

function TVRxControl.GetComponentIdArray(iSId: SYSINT; out pSCIdSs: OleVariant): HResult;
begin
Result := DefaultInterface.GetComponentIdArray(iSId, pSCIdSs);
end;

function TVRxControl.GetUserApplicationArray(iSId: SYSINT; iSCIdS: SYSINT;
out pUserApplications: OleVariant): HResult;
begin
Result := DefaultInterface.GetUserApplicationArray(iSId, iSCIdS, pUserApplications);
end;

function TVRxControl.GetUserApplicationData(iSId: SYSINT; iSCIdS: SYSINT; iUserApp: SYSINT;
out pUserApplicationData: OleVariant): HResult;
begin
Result := DefaultInterface.GetUserApplicationData(iSId, iSCIdS, iUserApp, pUserApplicationData);
end;

function TVRxControl.GetTransportMode(iSId: SYSINT; iSCIdS: SYSINT;
out pTransportMode: VRxTransportMode): HResult;
begin
Result := DefaultInterface.GetTransportMode(iSId, iSCIdS, pTransportMode);
end;

function TVRxControl.GetProgrammeType(iSId: SYSINT; out pProgType: VRxProgTypeCode): HResult;
begin
Result := DefaultInterface.GetProgrammeType(iSId, pProgType);
end;

function TVRxControl.GetDynamicProgrammeType(iSId: SYSINT; out pProgType: VRxProgTypeCode): HResult;
begin
Result := DefaultInterface.GetDynamicProgrammeType(iSId, pProgType);
end;

function TVRxControl.GetDataServiceComponentType(iSId: SYSINT; iSCIdS: SYSINT;
out pDataComponentType: SYSINT): HResult;
begin
Result := DefaultInterface.GetDataServiceComponentType(iSId, iSCIdS, pDataComponentType);
end;

function TVRxControl.StartPlaying(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult;
begin
Result := DefaultInterface.StartPlaying(iSId, iSCIdS, ok);
end;

function TVRxControl.IsPlaying(iSId: SYSINT; iSCIdS: SYSINT; out pbIsPlaying: Integer): HResult;
begin
Result := DefaultInterface.IsPlaying(iSId, iSCIdS, pbIsPlaying);
end;

function TVRxControl.StopPlaying(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult;
begin
Result := DefaultInterface.StopPlaying(iSId, iSCIdS, ok);
end;

function TVRxControl.StartDecoding(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult;
begin
Result := DefaultInterface.StartDecoding(iSId, iSCIdS, ok);
end;

function TVRxControl.StopDecoding(iSId: SYSINT; iSCIdS: SYSINT; out ok: Integer): HResult;
begin
Result := DefaultInterface.StopDecoding(iSId, iSCIdS, ok);
end;

function TVRxControl.IsDecoding(iSId: SYSINT; iSCIdS: SYSINT; out pbIsDecoding: Integer): HResult;
begin
Result := DefaultInterface.IsDecoding(iSId, iSCIdS, pbIsDecoding);
end;

function TVRxControl.GetDLS(iSId: SYSINT; iSCIdS: SYSINT; out pDLS: WideString): HResult;
begin
Result := DefaultInterface.GetDLS(iSId, iSCIdS, pDLS);
end;

function TVRxControl.GetFICBER(out pFICBER: Double): HResult;
begin
Result := DefaultInterface.GetFICBER(pFICBER);
end;

function TVRxControl.GetDABTime(out pDate: TDateTime): HResult;
begin
Result := DefaultInterface.GetDABTime(pDate);
end;

function TVRxControl.GetDABLocalTimeOffset(out dLTO: Double): HResult;
begin
Result := DefaultInterface.GetDABLocalTimeOffset(dLTO);
end;

function TVRxControl.GetVolume(out dVolume: Double): HResult;
begin
Result := DefaultInterface.GetVolume(dVolume);
end;

function TVRxControl.SetVolume(dVolume: Double): HResult;
begin
Result := DefaultInterface.SetVolume(dVolume);
end;

function TVRxControl.GetDABInfo(const Query: WideString; out pResponse: WideString): HResult;
begin
Result := DefaultInterface.GetDABInfo(Query, pResponse);
end;

function TVRxControl.SubscribeMSC(iSId: SYSINT; iSCIdS: SYSINT; const pDataSink: IVPDataSink;
out ok: Integer): HResult;
begin
Result := DefaultInterface.SubscribeMSC(iSId, iSCIdS, pDataSink, ok);
end;

function TVRxControl.SubscribePAD(iSId: SYSINT; iSCIdS: SYSINT; const pDataSink: IVPDataSink;
out ok: Integer): HResult;
begin
Result := DefaultInterface.SubscribePAD(iSId, iSCIdS, pDataSink, ok);
end;

function TVRxControl.SubscribeFIC(const pDataSink: IVPDataSink; out ok: Integer): HResult;
begin
Result := DefaultInterface.SubscribeFIC(pDataSink, ok);
end;

function TVRxControl.Unsubscribe(const pDataSink: IVPDataSink; out ok: Integer): HResult;
begin
Result := DefaultInterface.Unsubscribe(pDataSink, ok);
end;

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

function TVRxControlProperties.GetDefaultInterface: IVRxControl;
begin
Result := FServer.DefaultInterface;
end;

{$ENDIF}

procedure Register;
begin
RegisterComponents('RadioScape',[TVRxControl]);
end;

end.
=====================================

And the Container I have written is:
=====================================
unit EventSink;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, VIADAB_2Lib_TLB;

type
TEventSink = class(IVRxEventSink)
procedure Ensemble(bEnsembleAvailable: Integer);
procedure MultiplexConfiguration(bSignalled: Integer);
procedure Tracking(AGC: Integer; FT: Integer; SCT: Integer; AFC: Integer; SW: Integer;FIC: Integer);
procedure Error(eLevel: VRxErrorLevel; eCode: VRxErrorCode; strError: widestring);


end;

implementation


{ TEventSink }

procedure TEventSink.Ensemble(bEnsembleAvailable: Integer);
begin

end;

procedure TEventSink.Error(eLevel: VRxErrorLevel; eCode: VRxErrorCode;
strError: widestring);
begin
ShowMessage(strError);
end;

procedure TEventSink.MultiplexConfiguration(bSignalled: Integer);
begin

end;

procedure TEventSink.Tracking(AGC, FT, SCT, AFC, SW, FIC: Integer);
begin

end;

end.
========================================

I get an error, that states:
[Error] EventSink.pas(9): Class type required

What do I need to do to solvce this error. I need the container class to implement the Routines of IVRxEventSink and then allow me to process the results.

If anyone can shed any light then please contact me here on the forum or by e-mail: gordon-allan@bigfoot.com

Thanks

Gordon ALLAN
About gordon -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #2955, No Replies Be the first!
Thread Started 7/11/2001 10:02:00 AM
View Counter=1704
Location=-- USA 
Joined=3/23/2001   MB Posts=23  
www.prestwood.com For service: 916-726-5675
or support@prestwood.com
Copyright (C) Prestwood IT Solutions.
All Rights Reserved.
Printed 10/4/2022