How to query interface from MFC ActiveX Dlg Ctrl 
Author Message
 How to query interface from MFC ActiveX Dlg Ctrl

I have a dialog that displays an ActiveX control that I would like to use.
The MFC class wizard has wrapped the default dispinterface methods for me,
but the control has other interfaces I would like to use from my code.  How
can I obtain the interface from the object I want.  I tried getting the
IDispatch interface for the control by calling CCmdTarget::GetIDispatch on
the  CWnd control instance, but the QI failed when I tried to get the
desired interface.

I know that the ATL class CWindow offers a method called GetDlgControl()
that allows you to query an ActiveX control for a specific interface.  Is
there an equivalent in MFC?



Mon, 12 Sep 2005 19:21:52 GMT  
 How to query interface from MFC ActiveX Dlg Ctrl

Quote:
> I have a dialog that displays an ActiveX control that I would like to use.
> The MFC class wizard has wrapped the default dispinterface methods for me,
> but the control has other interfaces I would like to use from my code.
How
> can I obtain the interface from the object I want.  I tried getting the
> IDispatch interface for the control by calling CCmdTarget::GetIDispatch on
> the  CWnd control instance, but the QI failed when I tried to get the
> desired interface.

> I know that the ATL class CWindow offers a method called GetDlgControl()
> that allows you to query an ActiveX control for a specific interface.  Is
> there an equivalent in MFC?

The wrapper is derived from CWnd, and then you can use
CWnd::GetControlUnknown to get a LPUNKNOWN. I assume you know what to do
with it.

Yt,
Tom T.



Tue, 13 Sep 2005 00:29:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MFC dlg app, browser ctrl, ATL dochostui interface problem

2. ATL or MFC - creating a non-trivial ActiveX ctrl that supports multiple interfaces

3. MFC Custom Ctrl to ATL ActiveX conversation?

4. Subclassing a non-standard Window Ctrl in an ActiveX ctrl

5. Persistence support for ActiveX ctrl in MFC

6. Common File Dlg use with property sheets or tab ctrls

7. resize ctrls when dlg resizes

8. Send message from subclassed ctrl to parent dlg?

9. Send message from subclassed ctrl to parent dlg?

10. Custom interface in an MFC ActiveX Document

11. custom interface on MFC ActiveX control

 

 
Powered by phpBB® Forum Software