Home | Previous Page | Next Page   Using ActiveX Value Objects >

IRawObjectAccess Custom Interface

The IRawObjectAccess custom interface is provided for users of the IBM Informix ESQL/C API and the Microsoft ODBC API. IRawObjectAccess enables you to instantiate an ActiveX value object with raw data or to extract raw data from an existing value object.

If you are using the IBM Informix ESQL/C API or the Microsoft ODBC API and a query of the database server results in an ActiveX value object, you get the raw data of the object. You can use this data and the methods of the IRawObjectAccess interface to instantiate the ActiveX value object and access its custom methods.

To instantiate the ActiveX value object and access its custom methods
  1. Call CoCreateInstance() with a CLSID of CLSID_OPAQUE and an IID of IID_RawObjectAccess to create an empty ActiveX value object.
  2. Pass the raw object data to the SetDataC() method to fill the ActiveX value object.
  3. Use QueryInterface() to get the IID for the IDispatch interface (IID_IDispatch).
  4. Use IDispatch::Invoke() to access the custom methods of the ActiveX value object.

The IRawObjectAccess interface provides the following methods.

Method Description
void * GetDataC() Returns a pointer to OpaqueStruct, the C data structure that defines the opaque type that is encapsulated as an ActiveX value object.
SetDataC(void *struct) Sets OpaqueStruct to the values specified by struct.
void * GetDataCpp() Returns a pointer to OpaqueClient, the C++ object that represents the ActiveX value object.
SetDataCpp(void * struct) Sets OpaqueClient (returned by GetDataCpp) to the values specified by struct.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]