Pankaj
Pankaj

Reputation: 234

MFC XML Serialization

Can I serialize C++ class object to XML file using MFC Serialization. I found libraries like Boost, XML Foundation to perform this but I don't want to use any third party lib.

Is it possible in MFC C++ serialization or using any other core/native lib. Please help on this.

Upvotes: 0

Views: 1711

Answers (1)

Moo-Juice
Moo-Juice

Reputation: 38800

MFC does not have any native Xml serialization. You're either going to have to roll your own, or use a 3rd-party library. Why you have set yourself this false limitation is entirely unknown.

If it is size, or a dependency issue you are concerned about, I recommend TinyXml which you can include directly in to your C++ project and therefore have no dependencies and excellent Xml reading and writing. Note that this won't serialize an object by default, you'll have to use the class to write the Xml out yourself.

Alternatively you can look at this link in CodeProject on Xml serialization. Once again, this will require effort on your behalf.

Upvotes: 1

Related Questions