wxRichTextCtrl SaveFile as xml Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
kea_
Experienced Solver
Experienced Solver
Posts: 59
Joined: Wed Oct 17, 2007 7:32 am

wxRichTextCtrl SaveFile as xml

Post by kea_ » Tue Oct 21, 2008 9:56 am

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
kea_

chris_bern
Earned some good credits
Earned some good credits
Posts: 125
Joined: Wed Mar 05, 2008 3:30 pm

Post by chris_bern » Tue Oct 21, 2008 10:42 am

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);
Chris

kea_
Experienced Solver
Experienced Solver
Posts: 59
Joined: Wed Oct 17, 2007 7:32 am

Post by kea_ » Tue Oct 21, 2008 11:50 am

Ok,
it works...

Thank you very much for your great help.

kea_

chris_bern
Earned some good credits
Earned some good credits
Posts: 125
Joined: Wed Mar 05, 2008 3:30 pm

Post by chris_bern » Wed Oct 22, 2008 8:34 am

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.

Chris

Post Reply