CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2003
    Posts
    187

    Question HELP with a serialization dilemma!

    Hi there.
    I am in the middle of a dilemma. I created a file reader in VC++. This same program reads information stored in a file. This information was SERIALIZED into the file using VC++. When I open the file in note pad, I can see a little square before every field. This little square means the length of the following field, right? So far so good. The problem comes when I have to create a script using PHP to save information in files but I have to use the VC++ reader to display the info stored in the new files. Is there a way to simulate the VC++ “serialization” in PHP by just saving the fields length before each field or would be easier to modify the reader to cope with the PHP files? And how do I read those little squares in the VC++ serialization?

    Any suggestions, hints, clues?

    Thanks.
    Desva.
    Caminante no hay camino, se hace camino al andar.

  2. #2
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: HELP with a serialization dilemma!

    Quote Originally Posted by Desvario
    This little square means the length of the following field, right? So far so good.
    No - it can mean that, in a few cases, but need not. The "little square" is just nortepad's way to indicate that a value it found in the file can't be interpreted as a printable character. Keep in mind that the MFC serialization format is a binary one, and the resulting files are not text files. Also, they don't just contain the text content of CString objects with length information, but the complete serialization description of the object tree, version information end so on. So if you want to create a text file with a PHP script, and read that into your application, you can't use MFC serialization for that, but rather add an import function that reads and parses the text file (in a format that you can define) and then creates the required MFC objects.

  3. #3
    Join Date
    Apr 2003
    Posts
    187

    Re: HELP with a serialization dilemma!

    Hi there!
    Thanks for the reply.
    So let me see if i get it...
    So would be easier to set the VC++ to read a PHP rather than try to "serialize" using PHP ?

    thanks.
    Caminante no hay camino, se hace camino al andar.

  4. #4
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: HELP with a serialization dilemma!

    Quote Originally Posted by Desvario
    So would be easier to set the VC++ to read a PHP rather than try to "serialize" using PHP ?
    Yes. Or, rather, more precisely: To enhance your code written in C++ so that it can read text files generated by your PHP script.

  5. #5
    Join Date
    Apr 2003
    Posts
    187

    Re: HELP with a serialization dilemma!

    Thank you A LOT!
    I will take that approach!

    Cheers.
    Desva
    Caminante no hay camino, se hace camino al andar.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured