The source code for the MFC environment is included as part of Visual Studio, so you must install it on your computer. In general, when the framework launches a debug statement, you should go into the debugger and this will help you determine the exact cause of the problem.
After looking at the source code, I see that the function AFXGetRegPathcontains several statements:
ENSURE(lpszPostFix != NULL);
ASSERT_VALID(pApp);
ENSURE(AfxGetApp()->m_pszRegistryKey != NULL);
ENSURE(AfxGetApp()->m_pszProfileName != NULL);
If I had to guess, I would say that it m_pszRegistryKeychecks that this fails, perhaps because you are not calling the SetRegistryKeyapplication in your class InitInstance.
Hope this helps!
source
share