Prev: Drawing on DC
Next: VC6 project fails in VS2006
From: Herby on 17 Nov 2006 05:26 Can someone please help on this - im seriously baffled! When the MFC framework attempts to de-serialise the first class( its already de-serialised some CString and primitive types) it enters the following MFC method: CRuntimeClass* PASCAL CRuntimeClass::FromName(LPCSTR lpszClassName) { CRuntimeClass* pClass=NULL; ENSURE(lpszClassName); // search app specific classes AFX_MODULE_STATE* pModuleState = AfxGetModuleState(); AfxLockGlobals(CRIT_RUNTIMECLASSLIST); for (pClass = pModuleState->m_classList; pClass != NULL; pClass = pClass->m_pNextClass) { if (lstrcmpA(lpszClassName, pClass->m_lpszClassName) == 0) { AfxUnlockGlobals(CRIT_RUNTIMECLASSLIST); return pClass; } } .. For whatever reason? the pModuleState->m_classList is empty !!!! How does this get populated? Why would this be empty?
From: Herby on 17 Nov 2006 10:42 Guys, or anyone who has been following this - I think i may have solved it. A typical method of my COM class looks like this: LONG COMCalculator::OpenOleFile(LPCTSTR strOleFilePath) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); bool result = mCalc.OpenOleFile(strOleFilePath); if( result == true ) return S_OK; return S_FALSE; } When i comment out AFX_MANAGE_STATE(AfxGetStaticModuleState()) It worked. I understand this is useful when your component is a DLL and has resources. As mine does not i do not need to call it.
|
Pages: 1 Prev: Drawing on DC Next: VC6 project fails in VS2006 |