Article ID: 150204 - Last Review: November 21, 2006 - Revision: 4.1 How to retrieve the actual parent window of an ActiveX controlThis article was previously published under Q150204 On This PageSUMMARY An ActiveX control is created as a child of the window of
the container most closely associated with the site object. This article
describes how to obtain the parent window of an ActiveX control, and why
calling GetParent or CWnd::GetParent for an ActiveX control may not return its
actual parent window. MORE INFORMATION An ActiveX control typically gains access to the following
container windows:
When the MFC framework creates an ActiveX control's window, it retrieves the window associated with the container's site object by calling IOleInPlaceSite::GetWindow. The returned window is made the parent of the ActiveX control, except in the following two cases, where the framework creates a reflector window that reflects the notification messages:
Note If IOleObject::DoVerb with OLEIVERB_OPEN is invoked on an ActiveX control, and if in-place activation is not possible, an outer frame window is created and becomes the parent of the ActiveX control. Sample codeREFERENCES
APPLIES TO
| Article Translations
|

Back to the top
