I am attempting to migrate a Visual C++ 6.0 program (originally written on a Windows NT machine) to Visual C++ 2010 for use on my 64-bit Windows 7 PC. The program compiles fine but there is a runtime assertion failure which yeilds the following output in the debugger:
CoCreateInstance of OLE control {F9043C85-F6F2-101A-A3C9-08002B2F49FB} failed.
Result code: 0x80040154
Is the control is properly registered?
Warning: Resource items and Win32 Z-order lists are out of sync. Tab order may be not defined well.
Warning: CreateDlgControls failed during dialog init.
The failed assertion is on line 925 of occcont.cpp:
ASSERT(IsWindow(pTemp->m_hWnd));
I understand from http://dynamicsuser.net/forums/p/25968/140697.aspx that the Microsoft Common Dialog Control v6.0 might not be registered. I registered it with Regsrv32.exe and restarted windows but the error persists.
My goal is to tell whether this old program can work with new tools--not to actually rewrite the old program (though that will come later). Is it possible to make the old program run on my newer machine?
EDIT: Addition of the code which causes the assertion failure
BOOL CCameraSimulationApp::InitInstance()
{
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
INITCOMMONCONTROLSEX InitCtrlEx;
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
InitCtrlEx.dwICC = ICC_PROGRESS_CLASS;
if (!InitCommonControlsEx(&InitCtrlEx))
{
printf("Common Controls failed to initialize");//debug
}
CCameraSimulationDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
...