The information in this article applies to:
SYMPTOMSAn MFC ActiveX control that subclasses any of the window classes implemented by Comctl32.dll causes the following error to be thrown from a Visual Basic .exe. The debug version of the ActiveX control causes an ASSERT in file Ctlcore.cpp, at the end of COleControl::CreateControlWindow, on or near line 662. This problem occurs only when you build an .exe from Visual Basic and run it from outside the Visual Basic development environment. CAUSEMicrosoft Visual Basic executables do not initialize the common control library (Comctl32.dll) by default, resulting in the CreateEx call failing in COleControl::CreateControlWindow. Calling GetLastError() gives 0x0000057F - Cannot find window class, which indicates the common control library needs to be explicitly initialized. RESOLUTIONInside the InitInstance of your ActiveX control, make a call to: or This ensures that Comctl32.dll is loaded and initialized, regardless of the container the control is running in.Instead of calling InitCommonControls from the control's code, you can also call it directly from the Visual Basic client application:
STATUSThis behavior is by design. MORE INFORMATIONSteps to Reproduce Behavior
Additional query words: comctl32.dll MFC VB
Keywords : kbole kbActiveX kbCmnCtrls kbMFC kbVBp kbVBp500 kbVBp600 kbVC kbVC500 kbVC600 kbDSupport |
Last Reviewed: July 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |