Writing xml with mfc app
Posted on 2004-10-29
I want to write an xml file on a button click.
Under the button I have
XmlTextWriter w = new XmlTextWriter("D:\\rich\\test.xml");
but I get an error message saying that w cannot be destroyed. I got this code from the ms web stie and cannot work out why it is saying it.
I can write a blank empty file by
CreateFile(D:\\rich\\test.xml, FILE_WRITE_DATA, FILE_SHARE_READ, NULL, CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL);
but I need it to contain some xml dependent on the options selected in my MFC form
Thanks in advance