[ACXFAQ013]
I'm having problems creating ActiveX controls in a MFC DLL...


You will need to setup your MFC DLL to support ActiveX controls by inserting the following lines before creating any ActiveX controls or Dialogs that contain ActiveX controls. This applies to any ActiveX control, not just ones from Iocomp Software.

CoInitialize(NULL);
AfxEnableControlContainer();

For example, see the section "Setup ActiveX Support" below...

EXPORTDLL(void) FuncDll()
{
// ensure we are using our own resources
AFX_MANAGE_STATE(AfxGetStaticModuleState());

// setup ActiveX support
CoInitialize(NULL);
AfxEnableControlContainer();

// create dialog
if( testDlg.DoModal() == -1 )
{
AfxMessageBox("Dialog box could not be created!");
}

return;
}


Copyright ©1998-2007 Iocomp Software Incorporated. Iocomp and the Iocomp Logo are registered trademarks of Iocomp Software Inc. All other trademarks are registered by their respective owners.