Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Serialization

Serialization

Scheduled Pinned Locked Moved C / C++ / MFC
jsonquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MemLeak
    wrote on last edited by
    #1

    Hi! I'm trying to make serialization to work, I tried this: try { CFile file(_T("SerialTest.dat"), CFile::modeWrite | CFile::modeCreate); CArchive ar(&file, CArchive::store); int a = 3,b = 5; CString str(_T("Hello")); if( ar.IsStoring() ) { ar<ReportError(); e->Delete(); } The file is created, but is empty.. any ideas? thanks Mykel Everything's beautiful if you look at it long enough...

    H D 2 Replies Last reply
    0
    • M MemLeak

      Hi! I'm trying to make serialization to work, I tried this: try { CFile file(_T("SerialTest.dat"), CFile::modeWrite | CFile::modeCreate); CArchive ar(&file, CArchive::store); int a = 3,b = 5; CString str(_T("Hello")); if( ar.IsStoring() ) { ar<ReportError(); e->Delete(); } The file is created, but is empty.. any ideas? thanks Mykel Everything's beautiful if you look at it long enough...

      H Offline
      H Offline
      Hans Ruck
      wrote on last edited by
      #2

      Try

      if( ar.IsStoring() )
      {
      ar<

      rechi

      1 Reply Last reply
      0
      • M MemLeak

        Hi! I'm trying to make serialization to work, I tried this: try { CFile file(_T("SerialTest.dat"), CFile::modeWrite | CFile::modeCreate); CArchive ar(&file, CArchive::store); int a = 3,b = 5; CString str(_T("Hello")); if( ar.IsStoring() ) { ar<ReportError(); e->Delete(); } The file is created, but is empty.. any ideas? thanks Mykel Everything's beautiful if you look at it long enough...

        D Offline
        D Offline
        Dominik Reichl
        wrote on last edited by
        #3

        Close the archive before closing the file:

        ar.Close();
        file.Close();

        :-D -Dominik


        _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups