Hi,
 
I have a full server/container MFC app. I'm trying to serialize the embeded OLE objects in an independent file (e.g. I don't want my document file to save the ole objects, I want them in a separate one). This is what I'm doing:
 
//SAVE OLE OBJECTS
CFile fil( "test.ole", CFile::modeWrite | CFile::modeCreate ); 
CArchive ar( &fil, CArchive::store ); 
COleServerDoc::Serialize(ar);
 
(...)
 
//LOAD OLE OBJECTS
TRY
    {   
     CFile fil( "test.ole", CFile::modeRead );
     CArchive ar( &fil, CArchive::load );
     COleServerDoc::Serialize(ar);
    }
    CATCH( CFileException, e )
    {    
     (...)  
  }
    END_CATCH
 
 
It seems that the file is properly saved, but when I try to load it, I get a debug assertion when COleServerDoc::Serialize(ar) is called.
 
What I'm doing wrong?
 
Thanks,
Carlos
 
 
 

Reply via email to