Need help serializing object in c++
-
Hi, I'm trying to send an object across a network and I'm trying to implement serialization but I'm not doing it right. I tried searching for tutorials and articles but they're for C#. [Serializable] __gc class FileTransferHeader { public: FileTransferHeader(String* theFileName, Int64 theFileSize); __property Int64 get_Size(){return fileSize;} __property String* get_Name(); private: Char fileName __nogc[256]; Int64 fileSize; Int16 fileNameLength; }; and later in some other class that has a networkstream, and a BinaryFormatter() and an object of type FileTransferHeader named theHeader. I try theBinaryFormatter->Serialize(theNetworkStream, theHeader); and I get an UE. Unhandled Exception: System.Runtime.Serialization.SerializationException: The type $ArrayType$0x2984d64b in Assembly WinsockContinued, Version=1.0.792.39872, Culture=neutral, PublicKeyToken=null is not marked as serializable. -------------------------- One problem with the programmer's mentality is insecurity. This goes deep. An insulting college litany says that failed mathematicians become computer programmers. They are also ridiculed for being nerdy losers, for being too fat or too skinny, and for having few social skills. Most programmers can be spotted easily in a crowd. Nobody really wants to hang out with them. Put thousands of these people in one company and if you can get them to work, you become a billiona