Article ID: 156051 - Last Review: November 21, 2006 - Revision: 4.1 Windows messages are not sent to the CWnd-derived class when you create ActiveX Controls dynamically though CWnd::CreateControl in Visual C++This article was previously published under Q156051 Note Microsoft Visual C++ .NET 2002 and Microsoft Visual C++ .NET 2003 support both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The information in this article applies only to unmanaged Visual C++ code. SYMPTOMS When you create ActiveX Controls dynamically via
CWnd::CreateControl(), Windows messages are not sent to your CWnd-derived
class. For example, if you create a handler for WM_KILLFOCUS, it is not called.
CAUSE CWnd::CreateControl() does not subclass the HWND associated
with the control. RESOLUTION To work around this problem, you must subclass the control
after it has been created. The following steps illustrate how to insert an ActiveX Control and create a message handler for it:
STATUS
This behavior is by design. APPLIES TO
| Article Translations
|
Back to the top
