   Writing Classes to File
  I have a file (CFile object) and I want to output several classes of data out to the file. I think that this might be a problem, as classes have methods, which obviously cannot be stored in the file.My classes have STL Vectors of classes which contains other classes, so I think just sending each attribute out to file would be very tedious. Anyone got any ideas, Thanks,Keith 
  Are we talking about storing actual class definitions or instances? ;  Well, I''m not quite sure what you''re aiming for, but you might be looking for a serialization system similar to the one presented in Enginuity,  Part V.John B ;  If you mean saving the state of the variable ... then this is called Serialization or Persistence (or even the Memento Pattern).Most people usuually do it by inplementing some sort of ISerializable interface on objects which support it ... will functions like Serialize(outputFile) Deserialize(inputFile) ... and then when implementing Serialize for any given class, you just call Serialize on any internal members which support ISerialize, and manually write out any members which do not.You do not write things like functions - as those are not actual data for the object - they do not change object by object, and are inheirantly bound to the object by the fact that the object is of a certain type.You also do not write things like "static" data members, as those are not owned by the object either, but instead should be serialized as part of the class ...The ideas are trivial, the work is not ...since you are using MFC, look up the MFC serialization system (they already have a framework in place).