Title: RE: [msvc] Automation, IDispatch, Class Explosing The Interface

> I'm pleased to say that I've found my answer.
>
> For reference, if you use VC's feature whereby you can add a class
> from a TLB file (through the Class Wizard), then OCX 1 can add a
> wrapper class for OCX 2 into its project.
>
> The wrapper class has three constructors - one of which accepts an
> LPDISPATCH (= IDispatch *), which is exactly what I wanted - it
> creates the wrapper class around the existing interface, giving me
> access to the OCX instance's methods (handling the invoking under the
> hood in the wrapper class).

Although this works, but the method Dee shows (using QueryInterface( )
for your own dual or private interface) is far more efficient, since the
IDispatch driver insists on using IDispatch::Invoke( ), which is
anything but efficient compared to native C++ method calls.

-------------
Ehsan Akhgari

List Owner: [EMAIL PROTECTED]

[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

"In Heaven an angel is nobody in particular."
 George Bernard Shaw

Reply via email to