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)
// search app specific classes
AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
for (pClass = pModuleState->m_classList; pClass != NULL;
pClass = pClass->m_pNextClass)
if (lstrcmpA(lpszClassName, pClass->m_lpszClassName) == 0)
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
A typical method of my COM class looks like this:
LONG COMCalculator::OpenOleFile(LPCTSTR strOleFilePath)
bool result = mCalc.OpenOleFile(strOleFilePath);
if( result == true )
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.