Page 1 of 1

wxRichTextCtrl SaveFile as xml

Posted: Tue Oct 21, 2008 9:56 am
by kea_
Hello together,

I have a wxRichTextCtrl (rtc).
If I try to Save a file (rtc->SaveFile("d:\myfile.xml");)
I get the error: The text couldn't be saved.
I just can save it with the attribute wxRICHTEXT_TYPE_TEXT.
But then I can't save images to the file.

Has any body an idea?

Greetings and thanks

Posted: Tue Oct 21, 2008 10:42 am
by chris_bern
You need to add the line below somewhere in your application initialization part, like in OnInit() of wxApp.

Code: Select all

wxRichTextBuffer::AddHandler(new wxRichTextXMLHandler);

Posted: Tue Oct 21, 2008 11:50 am
by kea_
it works...

Thank you very much for your great help.


Posted: Wed Oct 22, 2008 8:34 am
by chris_bern
You are welcome. You can close the topic as accepted in order to save the time on those that will click on this topic to provide help. (current topic state: unsolved). Clicking on the answer/user that helped supports the wxAward system.