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

BTW, my previous answer will still work in this context as well, if there is
a need to hit internal stuff. The call itself is safe even with the spoofing
since it's marked local, provided you cast it properly (I recommend using
reinterpret_cast).

I've got a local smart pointer templated class which does this behind the
scenes and allows copying out the Interface or direct class access w/ an
overload of '->'. Be happy to send a copy privately to anyone who's
interested.

Ciao,
Dee

-----Original Message-----
From: BeginThread.com MSVC List [mailto:[EMAIL PROTECTED]]On Behalf
Of Jason Teagle
Sent: Thursday, September 11, 2003 11:11 AM
To: [EMAIL PROTECTED]
Subject: 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).

Woohoo!

--
Jason Teagle
[EMAIL PROTECTED]

Reply via email to