Avatar of CSD-GW
CSD-GW

asked on 

Remote Control API

I have an nvRemote (UR88A) and a USB nvReceiver  (CM21A). I want to be able to respond to remote control key presses from the remote control in my own software developen in C++ Builder, but I cannot locate any information about how to start doing this. Can anyone suggest what API I need to use, or even better  a ready made class to do this.
Editors IDEsC++

Avatar of undefined
Last Comment
CSD-GW
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of George Tokas
George Tokas
Flag of Greece image

>>USB nvReceiver  (CM21A).
I assume this IS a device pluged in PC USB socket...
I also assume that there is a monitor software for that as demo at least...
So there has to be an SDK to work with...
Are anything of the above real?
Those for starters before we try to help you....

George Tokas.
Avatar of CSD-GW
CSD-GW

ASKER

The reference to X10 sent me send me searching, so I found the ActiveHome SDK. When this is installed, I can run the examples, and see commands being received from the remote. I installed the ActiveX control into builder, BUT when the following code is called (i.e. I press a button on the remote control) an EVariantBadVarTypeError exception is thrown.

The ONLY code I have written below is the ';' all the rest is generated by Builder when I double click on the OnX10Command event in the Object Inspector.

void __fastcall TForm1::X10Interface1X10Command(TObject *Sender,
      BSTR bszCommand, EX10Command eCommand, long lAddress,
      EX10Key EKeyState, long lSequence, EX10Comm eCommandType,
      Variant varTimestamp)
{
;        
}

where is called this function from?
Avatar of CSD-GW
CSD-GW

ASKER

It is called by an internal event within C++ builder, i.e. somehow the ActiveX generates an event which causes builder to call my code in the event handler (which in the example was just ;).
I believe C++ builder creates the template from this based on the activeX file.
the builder will generate a wrapper class, could you see the internals of this wrapper?
Avatar of CSD-GW
CSD-GW

ASKER

The following files (I thing) are the wrappers:

NB IF I change the typedef as below:

typedef void __fastcall (__closure * TX10ControlX10Command)(System::TObject * Sender,
                                                            BSTR bszCommand,
                                                            X10_tlb::EX10Command eCommand,
                                                            long lAddress,
                                                            X10_tlb::EX10Key EKeyState,
                                                            long lSequence,
                                                            X10_tlb::EX10Comm eCommandType,
                                                            VARIANT varTimestamp);
by removing the line for VARIANT varTimestamp, and also remove the equivalent in the generated handler, the code will compile and run. (Builder moans a lot about the declaration not matching, and
offers to remove the reference, but hen declined does build a working file!)

Header:


// ************************************************************************ //
// 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.                                        
// ************************************************************************ //

// C++ TLBWRTR : $Revision:   1.151.1.0.1.27  $
// File generated on 23/07/2008 15:04:39 from Type Library described below.

// ************************************************************************  //
// Type Lib: C:\Program Files\Common Files\X10\Common\x10net.dll (1)
// LIBID: {001000AF-1DEF-0001-10B6-DC5BA692C858}
// LCID: 0
// Helpfile:
// HelpString: X10 Controls
// DepndLst:
//   (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
// ************************************************************************ //
#ifndef   X10_OCXH
#define   X10_OCXH

#pragma option push -b -w-inl

#include
#include
#if !defined(__UTILCLS_H_VERSION) || (__UTILCLS_H_VERSION < 0x0600)
//
// The code generated by the TLIBIMP utility or the Import|TypeLibrary
// and Import|ActiveX feature of C++Builder rely on specific versions of
// the header file UTILCLS.H found in the INCLUDE\VCL directory. If an
// older version of the file is detected, you probably need an update/patch.
//
#error "This file requires a newer version of the header UTILCLS.H" \
       "You need to apply an update/patch to your copy of C++Builder"
#endif
#include
#include
#if !defined(_NO_VCL)
#include
#endif  //   _NO_VCL
#include

#include "X10_TLB.h"
namespace X10_tlb
{

// *********************************************************************//
// HelpString: X10 Controls
// Version:    1.0
// *********************************************************************//


// *********************************************************************//
// COM Component Proxy Class Declaration
// Component Name   : TX10Control
// Help String      : X10 Control Class
// Default Interface: IX10Control
// Def. Intf. Object: TCOMIX10Control
// Def. Intf. DISP? : No
// Event   Interface: _DIX10ControlEvents
// TypeFlags        : (2) CanCreate
// *********************************************************************//

// *********************************************************************//
// Definition of closures to allow VCL handlers to catch OCX events.      
// *********************************************************************//
typedef void __fastcall (__closure * TX10ControlX10Command)(System::TObject * Sender,
                                                            BSTR bszCommand,
                                                            X10_tlb::EX10Command eCommand,
                                                            long lAddress,
                                                            X10_tlb::EX10Key EKeyState,
                                                            long lSequence,
                                                            X10_tlb::EX10Comm eCommandType,
                                                            VARIANT varTimestamp);
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
// Proxy class to host X10 Control Class in CBuilder IDE/Applications.
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
class PACKAGE TX10Control : public TOleControl
{
  OVERLOADED_PROP_METHODS;
  static TNoParam  OptParam;
  static GUID      DEF_CTL_INTF;

  // Instance of Closures to expose OCX Events as VCL ones
  //
  TX10ControlX10Command          FOnX10Command;

  // Default Interace of OCX
  //
  TCOMIX10Control m_OCXIntf;

  // VCL Property Getters/Setters which delegate to OCX
  //
  X10_tlb::IX10InterfacePtr __fastcall get_Interface(void);
  TVariant        __fastcall get_Control(void);

  // Static variables used by all instances of OCX proxy
  //
  static int          EventDispIDs[1];
  static TControlData CControlData;
  static GUID         CTL_DEF_INTF;

  // Method providing access to interface as __property
  //
  TCOMIX10Control __fastcall GetDefaultInterface();
  TCOMIX10Control __fastcall GetControlInterface()
  { return GetDefaultInterface(); }

protected:
  void     __fastcall CreateControl  ();
  void     __fastcall InitControlData();

public:
  virtual  __fastcall TX10Control(TComponent* AOwner) : TOleControl(AOwner)
  {};
  virtual  __fastcall TX10Control(HWND        Parent) : TOleControl(Parent)
  {};

  // OCX methods
  //
  TVariant        __fastcall Command(VARIANT varCommand/*[in]*/, VARIANT varParam/*[in]*/);
  void            __fastcall Show(VARIANT_BOOL fIsHideOnCloseSet/*[in]*/);
  void            __fastcall Hide(void);
  void            __fastcall Close(void);

  // OCX properties
  //
  __property X10_tlb::IX10InterfacePtr Interface={ read=get_Interface };
  __property System::OleVariant Control={ read=GetOleVariantProp, index=1 };
  __property TCOMIX10Control ControlInterface={ read=GetDefaultInterface };

  // Published properties
  //
__published:

  // Standard/Extended properties
  //
  __property TabStop;
  __property Align;
  __property DragCursor;
  __property DragMode;
  __property ParentShowHint;
  __property PopupMenu;
  __property ShowHint;
  __property TabOrder;
  __property Visible;
  __property OnDragDrop;
  __property OnDragOver;
  __property OnEndDrag;
  __property OnEnter;
  __property OnExit;
  __property OnStartDrag;

  // OCX properties
  //

  // OCX Events
  //
  __property TX10ControlX10Command OnX10Command={ read=FOnX10Command, write=FOnX10Command };
};
typedef TX10Control  TX10ControlProxy;


// *********************************************************************//
// COM Component Proxy Class Declaration
// Component Name   : TX10Interface
// Help String      : X10 Interface Class
// Default Interface: IX10Interface
// Def. Intf. Object: TCOMIX10Interface
// Def. Intf. DISP? : No
// Event   Interface: _DIX10InterfaceEvents
// TypeFlags        : (2) CanCreate
// *********************************************************************//

// *********************************************************************//
// Definition of closures to allow VCL handlers to catch OCX events.      
// *********************************************************************//
typedef void __fastcall (__closure * TX10InterfaceX10Command)(System::TObject * Sender,
                                                              BSTR bszCommand,
                                                              X10_tlb::EX10Command eCommand,
                                                              long lAddress,
                                                              X10_tlb::EX10Key EKeyState,
                                                              long lSequence,
                                                              X10_tlb::EX10Comm eCommandType,
                                                              VARIANT varTimestamp);
typedef void __fastcall (__closure * TX10InterfaceX10HelpEvent)(System::TObject * Sender,
                                                                long hwndDialog, long lHelpID);
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
// Proxy class to host X10 Interface Class in CBuilder IDE/Applications.
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
class PACKAGE TX10Interface : public TOleControl
{
  OVERLOADED_PROP_METHODS;
  static TNoParam  OptParam;
  static GUID      DEF_CTL_INTF;

  // Instance of Closures to expose OCX Events as VCL ones
  //
  TX10InterfaceX10Command        FOnX10Command;
  TX10InterfaceX10HelpEvent      FOnX10HelpEvent;

  // Default Interace of OCX
  //
  TCOMIX10Interface m_OCXIntf;

  // VCL Property Getters/Setters which delegate to OCX
  //
  void            __fastcall set_Connection(VARIANT vConnection/*[in]*/);
  TVariant        __fastcall get_Connection(void);
  void            __fastcall set_Device(VARIANT vDevice/*[in]*/);
  TVariant        __fastcall get_Device(void);
  X10_tlb::IXConnectionsPtr __fastcall get_Connections(void);
  X10_tlb::IXDevicesPtr __fastcall get_Devices(void);
  X10_tlb::IXCommandsPtr __fastcall get_Commands(void);
  X10_tlb::IXObjectsPtr __fastcall get_Objects(void);
  X10_tlb::IXDeviceTypesPtr __fastcall get_DeviceTypes(void);
  X10_tlb::IXConnectionTypesPtr __fastcall get_ConnectionTypes(void);
  TVariant        __fastcall get_Version(void);

  // Static variables used by all instances of OCX proxy
  //
  static int          EventDispIDs[2];
  static TControlData CControlData;
  static GUID         CTL_DEF_INTF;

  // Method providing access to interface as __property
  //
  TCOMIX10Interface __fastcall GetDefaultInterface();
  TCOMIX10Interface __fastcall GetControlInterface()
  { return GetDefaultInterface(); }

protected:
  void     __fastcall CreateControl  ();
  void     __fastcall InitControlData();

public:
  virtual  __fastcall TX10Interface(TComponent* AOwner) : TOleControl(AOwner)
  {};
  virtual  __fastcall TX10Interface(HWND        Parent) : TOleControl(Parent)
  {};

  // OCX methods
  //
  TVariant        __fastcall SendPriority(VARIANT vCommand/*[in]*/, VARIANT vScope/*[in]*/,
                                          VARIANT vAddress/*[in,def,opt]*/,
                                          VARIANT vDuration/*[in,def,opt]*/);
  TVariant        __fastcall Send(VARIANT vCommand/*[in]*/, VARIANT vScope/*[in]*/,
                                  VARIANT vAddress/*[in,def,opt]*/,
                                  VARIANT vDuration/*[in,def,opt]*/, VARIANT vWait/*[in,def,opt]*/);
  TVariant        __fastcall SendKeyDown(VARIANT vCommand/*[in]*/, VARIANT vScope/*[in]*/,
                                         VARIANT vAddress/*[in,def,opt]*/);
  TVariant        __fastcall SendKeyUp(VARIANT vCommand/*[in]*/, VARIANT vScope/*[in]*/,
                                       VARIANT vAddress/*[in,def,opt]*/);
  void            __fastcall _Update(void);
  long            __fastcall QueueDepth(void);
  long            __fastcall QueueDepthWithCommand(VARIANT vCommand/*[in]*/);
  void            __fastcall CancelAllCommands(void);
  void            __fastcall StartRecord(void);
  X10_tlb::IXCommandPtr __fastcall StopRecord(VARIANT vCommand/*[in]*/);
  void            __fastcall SuspendCommands(void);
  void            __fastcall Breakpoints(X10_tlb::IXProperties** ppBreakpoints);
  void            __fastcall ResumeCommands(void);
  void            __fastcall SingleCommandOver(void);
  void            __fastcall SingleCommandInto(void);
  void            __fastcall GetNextCommand(void);
  void            __fastcall CheckCommand(void);
  X10_tlb::IXRecvCommandPtr __fastcall LastRecv(long lHistoryIndex/*[in,def,opt]*/);
  X10_tlb::IXSendCommandPtr __fastcall LastSend(long lHistoryIndex/*[in,def,opt]*/);
  X10_tlb::IX10ControlPtr __fastcall CreateControl1(VARIANT varControl/*[in]*/,
                                                    VARIANT varSkin/*[in]*/);
  long            __fastcall GetAdaptersPresent(long lAdapterType/*[in]*/);
  void            __fastcall SetAdapterDefaultHouseCode(long lAdapter/*[in]*/,
                                                        long lHouseCode/*[in]*/);
  long            __fastcall GetAdapterDefaultHouseCode(long lAdapter/*[in]*/);
  long            __fastcall GetIsAdvancedRemote(void);

  // OCX properties
  //
  __property System::OleVariant Connection={ read=GetOleVariantProp, write=SetOleVariantProp, index=1 };
  __property System::OleVariant Device={ read=GetOleVariantProp, write=SetOleVariantProp, index=2 };
  __property X10_tlb::IXConnectionsPtr Connections={ read=get_Connections };
  __property X10_tlb::IXDevicesPtr Devices={ read=get_Devices };
  __property X10_tlb::IXCommandsPtr Commands={ read=get_Commands };
  __property X10_tlb::IXObjectsPtr Objects={ read=get_Objects };
  __property X10_tlb::IXDeviceTypesPtr DeviceTypes={ read=get_DeviceTypes };
  __property X10_tlb::IXConnectionTypesPtr ConnectionTypes={ read=get_ConnectionTypes };
  __property System::OleVariant Version={ read=GetOleVariantProp, index=31 };
  __property TCOMIX10Interface ControlInterface={ read=GetDefaultInterface };

  // Published properties
  //
__published:

  // Standard/Extended properties
  //
  __property TabStop;
  __property Align;
  __property DragCursor;
  __property DragMode;
  __property ParentShowHint;
  __property PopupMenu;
  __property ShowHint;
  __property TabOrder;
  __property Visible;
  __property OnDragDrop;
  __property OnDragOver;
  __property OnEndDrag;
  __property OnEnter;
  __property OnExit;
  __property OnStartDrag;

  // OCX properties
  //
  __property int RecvHistoryLength={ read=GetIntegerProp, write=SetIntegerProp, stored=false, index=28 };
  __property int SendHistoryLength={ read=GetIntegerProp, write=SetIntegerProp, stored=false, index=29 };
  __property int HouseCodeEventMask={ read=GetIntegerProp, write=SetIntegerProp, stored=false, index=32 };
  __property int UnitCodeEventMask={ read=GetIntegerProp, write=SetIntegerProp, stored=false, index=33 };

  // OCX Events
  //
  __property TX10InterfaceX10Command OnX10Command={ read=FOnX10Command, write=FOnX10Command };
  __property TX10InterfaceX10HelpEvent OnX10HelpEvent={ read=FOnX10HelpEvent, write=FOnX10HelpEvent };
};
typedef TX10Interface  TX10InterfaceProxy;

};     // namespace X10_tlb

#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using  namespace X10_tlb;
#endif

#pragma option pop

#endif // X10_OCXH

//----------------------------------------------------------------------------------------------------------------------
C++ File
//----------------------------------------------------------------------------------------------------------------------
// ************************************************************************ //
// 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.                                        
// ************************************************************************ //

// C++ TLBWRTR : $Revision:   1.151.1.0.1.27  $
// File generated on 23/07/2008 15:04:39 from Type Library described below.

// ************************************************************************  //
// Type Lib: C:\Program Files\Common Files\X10\Common\x10net.dll (1)
// LIBID: {001000AF-1DEF-0001-10B6-DC5BA692C858}
// LCID: 0
// Helpfile:
// HelpString: X10 Controls
// DepndLst:
//   (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
// Errors:
//   Hint: Symbol 'Update' renamed to '_Update'
// ************************************************************************ //

#include
#pragma hdrstop

#include
#if defined(USING_ATL)
#include
#endif

#include "X10_OCX.h"

#if !defined(__PRAGMA_PACKAGE_SMART_INIT)
#define      __PRAGMA_PACKAGE_SMART_INIT
#pragma package(smart_init)
#endif

namespace X10_tlb
{



// *********************************************************************//
// OCX PROXY CLASS IMPLEMENTATION
// (The following variables/methods implement the class TX10Control which
// allows "X10 Control Class" to be hosted in CBuilder IDE/apps).
// *********************************************************************//
int   TX10Control::EventDispIDs[1] = {
    0x00000000};

TControlData TX10Control::CControlData =
{
  // GUID of CoClass and Event Interface of Control
  {0x001000AF, 0x2DEF, 0x0001,{ 0x10, 0xB6, 0xDC,0x5B, 0xA6, 0x92,0xC8, 0x58} }, // CoClass
  {0x001000AF, 0x3DEF, 0x0002,{ 0x10, 0xB6, 0xDC,0x5B, 0xA6, 0x92,0xC8, 0x58} }, // Events

  // Count of Events and array of their DISPIDs
  1, &EventDispIDs,

  // Pointer to Runtime License string
  NULL,  // HRESULT(0x80004002)

  // Flags for OnChanged PropertyNotification
  0x00000000,
  300,// (IDE Version)

  // Count of Font Prop and array of their DISPIDs
  0, NULL,

  // Count of Pict Prop and array of their DISPIDs
  0, NULL,
  0, // Reserved
  0, // Instance count (used internally)
  0, // List of Enum descriptions (internal)
};

GUID     TX10Control::DEF_CTL_INTF = {0x001000AF, 0x3DEF, 0x0001,{ 0x10, 0xB6, 0xDC,0x5B, 0xA6, 0x92,0xC8, 0x58} };
TNoParam TX10Control::OptParam;

static inline void ValidCtrCheck(TX10Control *)
{
   delete new TX10Control((TComponent*)(0));
};

void __fastcall TX10Control::InitControlData()
{
  ControlData = &CControlData;
};

void __fastcall TX10Control::CreateControl()
{
  if (!m_OCXIntf)
  {
    _ASSERTE(DefaultDispatch);
    DefaultDispatch->QueryInterface(DEF_CTL_INTF, (LPVOID*)&m_OCXIntf);
  }
};

TCOMIX10Control __fastcall TX10Control::GetDefaultInterface()
{
  CreateControl();
  return m_OCXIntf;
};

TVariant __fastcall TX10Control::Command(VARIANT varCommand/*[in]*/, VARIANT varParam/*[in]*/)
{
  return GetDefaultInterface()->Command(varCommand/*[in]*/, varParam/*[in]*/);
}

void __fastcall TX10Control::Show(VARIANT_BOOL fIsHideOnCloseSet/*[in]*/)
{
  GetDefaultInterface()->Show(fIsHideOnCloseSet/*[in]*/);
}

void __fastcall TX10Control::Hide(void)
{
  GetDefaultInterface()->Hide();
}

void __fastcall TX10Control::Close(void)
{
  GetDefaultInterface()->Close();
}

X10_tlb::IX10InterfacePtr __fastcall TX10Control::get_Interface(void)
{
  return GetDefaultInterface()->get_Interface();
}

TVariant __fastcall TX10Control::get_Control(void)
{
  return GetDefaultInterface()->get_Control();
}



// *********************************************************************//
// OCX PROXY CLASS IMPLEMENTATION
// (The following variables/methods implement the class TX10Interface which
// allows "X10 Interface Class" to be hosted in CBuilder IDE/apps).
// *********************************************************************//
int   TX10Interface::EventDispIDs[2] = {
    0x00000000, 0x00000001};

TControlData TX10Interface::CControlData =
{
  // GUID of CoClass and Event Interface of Control
  {0x001000AF, 0x2DEF, 0x0002,{ 0x10, 0xB6, 0xDC,0x5B, 0xA6, 0x92,0xC8, 0x58} }, // CoClass
  {0x001000AF, 0x3DEF, 0x0024,{ 0x10, 0xB6, 0xDC,0x5B, 0xA6, 0x92,0xC8, 0x58} }, // Events

  // Count of Events and array of their DISPIDs
  2, &EventDispIDs,

  // Pointer to Runtime License string
  NULL,  // HRESULT(0x80004002)

  // Flags for OnChanged PropertyNotification
  0x00000000,
  300,// (IDE Version)

  // Count of Font Prop and array of their DISPIDs
  0, NULL,

  // Count of Pict Prop and array of their DISPIDs
  0, NULL,
  0, // Reserved
  0, // Instance count (used internally)
  0, // List of Enum descriptions (internal)
};

GUID     TX10Interface::DEF_CTL_INTF = {0x001000AF, 0x3DEF, 0x0003,{ 0x10, 0xB6, 0xDC,0x5B, 0xA6, 0x92,0xC8, 0x58} };
TNoParam TX10Interface::OptParam;

static inline void ValidCtrCheck(TX10Interface *)
{
   delete new TX10Interface((TComponent*)(0));
};

void __fastcall TX10Interface::InitControlData()
{
  ControlData = &CControlData;
};

void __fastcall TX10Interface::CreateControl()
{
  if (!m_OCXIntf)
  {
    _ASSERTE(DefaultDispatch);
    DefaultDispatch->QueryInterface(DEF_CTL_INTF, (LPVOID*)&m_OCXIntf);
  }
};

TCOMIX10Interface __fastcall TX10Interface::GetDefaultInterface()
{
  CreateControl();
  return m_OCXIntf;
};

TVariant __fastcall TX10Interface::SendPriority(VARIANT vCommand/*[in]*/, VARIANT vScope/*[in]*/,
                                                VARIANT vAddress/*[in,def,opt]*/,
                                                VARIANT vDuration/*[in,def,opt]*/)
{
  return GetDefaultInterface()->SendPriority(vCommand/*[in]*/, vScope/*[in]*/,
                                             vAddress/*[in,def,opt]*/, vDuration/*[in,def,opt]*/);
}

TVariant __fastcall TX10Interface::Send(VARIANT vCommand/*[in]*/, VARIANT vScope/*[in]*/,
                                        VARIANT vAddress/*[in,def,opt]*/,
                                        VARIANT vDuration/*[in,def,opt]*/,
                                        VARIANT vWait/*[in,def,opt]*/)
{
  return GetDefaultInterface()->Send(vCommand/*[in]*/, vScope/*[in]*/, vAddress/*[in,def,opt]*/,
                                     vDuration/*[in,def,opt]*/, vWait/*[in,def,opt]*/);
}

TVariant __fastcall TX10Interface::SendKeyDown(VARIANT vCommand/*[in]*/, VARIANT vScope/*[in]*/,
                                               VARIANT vAddress/*[in,def,opt]*/)
{
  return GetDefaultInterface()->SendKeyDown(vCommand/*[in]*/, vScope/*[in]*/,
                                            vAddress/*[in,def,opt]*/);
}

TVariant __fastcall TX10Interface::SendKeyUp(VARIANT vCommand/*[in]*/, VARIANT vScope/*[in]*/,
                                             VARIANT vAddress/*[in,def,opt]*/)
{
  return GetDefaultInterface()->SendKeyUp(vCommand/*[in]*/, vScope/*[in]*/, vAddress/*[in,def,opt]*/);
}

void __fastcall TX10Interface::_Update(void)
{
  GetDefaultInterface()->_Update();
}

long __fastcall TX10Interface::QueueDepth(void)
{
  return GetDefaultInterface()->QueueDepth();
}

long __fastcall TX10Interface::QueueDepthWithCommand(VARIANT vCommand/*[in]*/)
{
  return GetDefaultInterface()->QueueDepthWithCommand(vCommand/*[in]*/);
}

void __fastcall TX10Interface::CancelAllCommands(void)
{
  GetDefaultInterface()->CancelAllCommands();
}

void __fastcall TX10Interface::StartRecord(void)
{
  GetDefaultInterface()->StartRecord();
}

X10_tlb::IXCommandPtr __fastcall TX10Interface::StopRecord(VARIANT vCommand/*[in]*/)
{
  return GetDefaultInterface()->StopRecord(vCommand/*[in]*/);
}

void __fastcall TX10Interface::SuspendCommands(void)
{
  GetDefaultInterface()->SuspendCommands();
}

void __fastcall TX10Interface::Breakpoints(X10_tlb::IXProperties** ppBreakpoints)
{
  GetDefaultInterface()->Breakpoints(ppBreakpoints);
}

void __fastcall TX10Interface::ResumeCommands(void)
{
  GetDefaultInterface()->ResumeCommands();
}

void __fastcall TX10Interface::SingleCommandOver(void)
{
  GetDefaultInterface()->SingleCommandOver();
}

void __fastcall TX10Interface::SingleCommandInto(void)
{
  GetDefaultInterface()->SingleCommandInto();
}

void __fastcall TX10Interface::GetNextCommand(void)
{
  GetDefaultInterface()->GetNextCommand();
}

void __fastcall TX10Interface::CheckCommand(void)
{
  GetDefaultInterface()->CheckCommand();
}

X10_tlb::IXRecvCommandPtr __fastcall TX10Interface::LastRecv(long lHistoryIndex/*[in,def,opt]*/)
{
  return GetDefaultInterface()->LastRecv(lHistoryIndex/*[in,def,opt]*/);
}

X10_tlb::IXSendCommandPtr __fastcall TX10Interface::LastSend(long lHistoryIndex/*[in,def,opt]*/)
{
  return GetDefaultInterface()->LastSend(lHistoryIndex/*[in,def,opt]*/);
}

X10_tlb::IX10ControlPtr __fastcall TX10Interface::CreateControl1(VARIANT varControl/*[in]*/,
                                                                 VARIANT varSkin/*[in]*/)
{
  return GetDefaultInterface()->CreateControl(varControl/*[in]*/, varSkin/*[in]*/);
}

long __fastcall TX10Interface::GetAdaptersPresent(long lAdapterType/*[in]*/)
{
  return GetDefaultInterface()->GetAdaptersPresent(lAdapterType/*[in]*/);
}

void __fastcall TX10Interface::SetAdapterDefaultHouseCode(long lAdapter/*[in]*/,
                                                          long lHouseCode/*[in]*/)
{
  GetDefaultInterface()->SetAdapterDefaultHouseCode(lAdapter/*[in]*/, lHouseCode/*[in]*/);
}

long __fastcall TX10Interface::GetAdapterDefaultHouseCode(long lAdapter/*[in]*/)
{
  return GetDefaultInterface()->GetAdapterDefaultHouseCode(lAdapter/*[in]*/);
}

long __fastcall TX10Interface::GetIsAdvancedRemote(void)
{
  return GetDefaultInterface()->GetIsAdvancedRemote();
}

void __fastcall TX10Interface::set_Connection(VARIANT vConnection/*[in]*/)
{
  GetDefaultInterface()->set_Connection(vConnection/*[in]*/);
}

TVariant __fastcall TX10Interface::get_Connection(void)
{
  return GetDefaultInterface()->get_Connection();
}

void __fastcall TX10Interface::set_Device(VARIANT vDevice/*[in]*/)
{
  GetDefaultInterface()->set_Device(vDevice/*[in]*/);
}

TVariant __fastcall TX10Interface::get_Device(void)
{
  return GetDefaultInterface()->get_Device();
}

X10_tlb::IXConnectionsPtr __fastcall TX10Interface::get_Connections(void)
{
  return GetDefaultInterface()->get_Connections();
}

X10_tlb::IXDevicesPtr __fastcall TX10Interface::get_Devices(void)
{
  return GetDefaultInterface()->get_Devices();
}

X10_tlb::IXCommandsPtr __fastcall TX10Interface::get_Commands(void)
{
  return GetDefaultInterface()->get_Commands();
}

X10_tlb::IXObjectsPtr __fastcall TX10Interface::get_Objects(void)
{
  return GetDefaultInterface()->get_Objects();
}

X10_tlb::IXDeviceTypesPtr __fastcall TX10Interface::get_DeviceTypes(void)
{
  return GetDefaultInterface()->get_DeviceTypes();
}

X10_tlb::IXConnectionTypesPtr __fastcall TX10Interface::get_ConnectionTypes(void)
{
  return GetDefaultInterface()->get_ConnectionTypes();
}

TVariant __fastcall TX10Interface::get_Version(void)
{
  return GetDefaultInterface()->get_Version();
}


};     // namespace X10_tlb


// *********************************************************************//
// The Register function is invoked by the IDE when this module is
// installed in a Package. It provides the list of Components (including
// OCXes) implemented by this module. The following implementation
// informs the IDE of the OCX proxy classes implemented here.
// *********************************************************************//
namespace X10_ocx
{

void __fastcall PACKAGE Register()
{
  // [2]
  TComponentClass cls_ocx[] = {
                              __classid(X10_tlb::TX10Control),
                              __classid(X10_tlb::TX10Interface)
                           };
  RegisterComponents("ActiveX", cls_ocx,
                     sizeof(cls_ocx)/sizeof(cls_ocx[0])-1);
}

};     // namespace X10_ocx
Avatar of George Tokas
George Tokas
Flag of Greece image

>>TComponentClass cls_ocx[] = {
                              __classid(X10_tlb::TX10Control),
                              __classid(X10_tlb::TX10Interface)

There should be a tab added with the components for X10...
You can use them by dropping them on your form...
As for the handler with just a (;) add the functionality you want...
You know that function handlers without any code inside are deleted if you press F9...

George Tokas.
Avatar of CSD-GW
CSD-GW

ASKER

Thanks. The reference to X10 was the kick-start I needed. Will just live with the ActiveX workaround at the moment!
C++
C++

C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.

58K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo