What is wong? CArchive >> will fail if destination platform is x64, but x86 is ok.

  • Thread starter Thread starter doglas neo
  • Start date Start date
D

doglas neo

Guest
I was confused about x64 mode. Can someone help me?

I use vs 2012 update 1 as development tool.
1.Compile my project with destination platform x86, the code 'archive >> pObj' works ok.
2.Compile my project with destination platform x64, the code 'archive >> pObj' works NOT ok, pEx->m_cause is 3(means endOfFile).

Code snippet in my project:
------------------------------------------------------------------
class CMyObj : public CObject

...

BOOL CMyClass::Func(CArchive& archive)
{
...
try
{
...
CMyObj* pObj = NULL;
archive >> pObj;
if (NULL != pObj)
{
delete pObj;
}
...

}
catch (CArchiveException* pEx)
{
pEx->Delete ();
return FALSE;
}

return TRUE;
}

Continue reading...
 
Back
Top