wxRichTextCtrl - loading HTML file is not working
Posted: Mon Aug 27, 2018 2:28 pm
Hi All,
Need yet another help badly!
I have a wxRichTextCtrl instance, into which i need to load HTML contents, saved in the file "mail.html".
This is code i have, but it says "File could not be loaded", and the wxRichTextCtrl remains empty.
What wrong am i doing? Please help!
Need yet another help badly!
I have a wxRichTextCtrl instance, into which i need to load HTML contents, saved in the file "mail.html".
This is code i have, but it says "File could not be loaded", and the wxRichTextCtrl remains empty.
What wrong am i doing? Please help!
Code: Select all
wxRichTextCtrl* richTextMailBody = new wxRichTextCtrl(m_panelNBContainer, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxSize(400, 400), wxVSCROLL | wxHSCROLL | wxBORDER_NONE | wxWANTS_CHARS);
wxRichTextHTMLHandler* handler = new wxRichTextHTMLHandler();
wxRichTextBuffer buffer = richTextMailBody->GetBuffer();
buffer.AddHandler(handler);
richTextMailBody->LoadFile("./mail.html", wxRICHTEXT_TYPE_HTML);