I have a small problem with the wxRichtextCtrl class.
I would like to read an HTML formated string which I previously safed in a database into one of my wxRichtextCtrl elements, in a way that, the HTML formating is respected and shown as such in the wxRichtextctrl. For examlpe: my wxString in the database might be <b>bold</b> hence I would like the Richtextctrl to format "bold" - bold
Looking at the manual I came across the LoadFile function of the RichtextBuffer class which I thought is what I want:
LoadFile (wxInputStream &stream, wxRichTextFileType type=wxRICHTEXT_TYPE_ANY)
so I wrote:
Code: Select all
wxString buf(parent->current_db.get_card(0)->get_topentry());
rtb = &toptext->GetBuffer();
wxInputStream* SIStream;
SIStream->Read((void*)&buf,buf.length());
rtb->LoadFile(SIStream,wxRICHTEXT_TYPE_HTML);
'bool wxRichTextBuffer::LoadFile(const wxString &,wxRichTextFileType)' : cannot convert parameter 1 from 'wxInputStream *' to 'const wxString &'
1> Reason: cannot convert from 'wxInputStream *' to 'const wxString'
I run windows 7 wxwigets 2.9.5 and included the <wx/stream.h>
why can't the compiler find the second definition ?
Is there another way of solving my problem ? I find streams and "abstract base classes" confusing as hell and try to avoid them whenever possible.
Thank you for your time.