Board index » cppbuilder » Using COM control wrappers (import type library) - need COM object pointer

Using COM control wrappers (import type library) - need COM object pointer

Does anyone know how to get the underlying pointer to the COM object (or the
variant).  I have a function that requires a COM object as one of the
parameters, and i don't know what to pass it.  With the Visual C++ wrappers,
there's a function (GetObjectPointer, i think) that would do this.  Is there
an equivalent in the CBuilder wrappers that are generated when i import an
activex type library?

Specifically, I'm trying to use ADO with CBuilder, and i need to pass my
connection object as a parameter to a recordser object's call to open.

any help would be appreciated.  Thanks!

Nathan Teske

 

Re:Using COM control wrappers (import type library) - need COM object pointer


Can you use the address-of operator ( &) ?

Alex

Quote
Nathan Teske wrote:

[snip]

Re:Using COM control wrappers (import type library) - need COM object pointer


In article <7nnash$8...@forums.borland.com>,

Quote
Nathan Teske <Nath...@axonn.com> wrote:
>Does anyone know how to get the underlying pointer to the COM object (or the
>variant).  I have a function that requires a COM object as one of the
>parameters, and i don't know what to pass it.  With the Visual C++ wrappers,
>there's a function (GetObjectPointer, i think) that would do this.  Is there
>an equivalent in the CBuilder wrappers that are generated when i import an
>activex type library?

Do you need the CoClass or the Interface?

GetControlInterface() should work
if you are using a TOleControl wrapper
(something installed on the palette).

Otherwise, &classname should work.
--
Caminante, son tus huellas el camino, y nada mas;
caminante, no hay camino, se hace camino al andar ...
Caminante, no hay camino, sino estelas en el mar.

Other Threads