mfc CDocument Archive Serialize RRS feed

  • Question



    Newbie question.

    I have an MFC .NET application that establishes a CDocument object to a given flat binary file then reads data from a database then needs to write the data to the associate file.


    one approach is to amass a hue memory buffer when collecting then data then execute DoFileSave which triggers Serialize where the memory buffer can write the data to the file in a single action.


    But I would preferr to write the data from the database to the file as each piece of data is retrieved.  When I do this, the Serialize Write function resets the EOF to the beginning of the file then overwrites the last piece of data that was written.


    I also don't want to explicitly use the Win32 commands CreateFile, WriteFile, CloseHandle, although that would work too,


    So how do I append new data to the end of the file as it becomes available? Or what is the "preferred" procedure for doing this with MFC CDocument objects?



    Monday, November 5, 2007 2:50 PM