wxRichTextHTMLHandler calls an error on first time

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

wxRichTextHTMLHandler calls an error on first time

Post by kea_ » Thu Oct 23, 2008 6:05 am

Hello to all,

the first time I call the function below I get an error like:
'failed in GetFaceName()' but just the first time of this call after that it works fine.
Does anybody have a hint?

wxString csFileSystem::LoadFile(wxString sFile, wxHtmlWindow *htmlwindow){
sFile = m_sFolder + "/" + sFile + S_FILEEXTENSION;

wxString sHtml;
wxRichTextBuffer rtbBuffer;

// load xml
wxRichTextXMLHandler *rtXmlHandler = new wxRichTextXMLHandler();
rtXmlHandler->LoadFile(&rtbBuffer, sFile);

// load html
wxStringOutputStream sOutStream(&sHtml);

wxRichTextHTMLHandler rtHtmlHandler;
rtHtmlHandler.SetFlags(wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY);
rtHtmlHandler.SetFlags(wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64);
rtHtmlHandler.SetFlags(wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES);

if(rtHtmlHandler.SaveFile(&rtbBuffer, sOutStream)){
htmlwindow->SetPage(sHtml);
}

rtHtmlHandler.DeleteTemporaryImages();

return sFile;
}

Thanks for your answer
kea_
Attachments
GetFaceName.jpg
GetFaceName.jpg (17.49 KiB) Viewed 402 times

Post Reply