OLE Control Containers Must Call AfxEnableControlContainerID: Q150029
|
Using Visual C++ version 4.0, it is possible to construct OLE Control Containers. These containers must call AfxEnableControlContainer() in their CWinApp::InitInstance(). This call is added automatically if OLE Controls support is checked in AppWizard Step 3, but in some cases, this call must be added manually. This article explains why you need to call AfxEnableControlContainer() and the possible problems that might occur if this call is not made.
AfxEnableControlContainer() is responsible for wiring up the support
structure necessary for a CWnd object to contain an OLE Control. This call
is added to a project by AppWizard if OLE Controls support is selected. You
need to add this call manually in the following cases:
>>> If this dialog has OLE controls:
>>> AfxEnableControlContainer has not been called yet.
>>> You should call it in your app's InitInstance function.
ASSERT(afxOccManager != NULL);
Failed to create empty document.
Additional query words: kbvc410 kbvc400 kbvc500 kbvc600
Keywords : kbole kbCtrl kbMFC kbVC kbx86
Version : Winnet:4.0,4.1,5.0,6.0
Platform : NT WINDOWS
Issue type :
Last Reviewed: August 3, 1999