I have had a look at both of those links,
Code: Select all
void BasicFrame::OnOpenFile( wxCommandEvent & event )
wxFileDialog* openFileDialog =
new wxFileDialog( this, _("Open file"), "", "", FILETYPES,
if ( openFileDialog->ShowModal() == wxID_OK )
This didn't help, theText was not declared, I have no idea what it is (ie string...), and the compiler complains that it han't been declared. The compiler doesn't like the SetCurrentFilename and SetStatusText either, it says they havent been declared either. I tried adding the include file for file dialogs, and it the compiler still says the same thing.
When I looked at wxTextInputStream http://docs.wxwidgets.org/2.8.6/wx_wxte ... readstring
I found this code as an example:
Code: Select all
wxFileInputStream input( "mytext.txt" );
wxTextInputStream text( input );
text >> i1; // read a 8 bit integer.
text >> i1 >> f2; // read a 8 bit integer followed by float.
text >> line; // read a text line
Which needs the include file <wx/txtstrm.h>. When i try that the compiler says wxFileInputStream and wxTextInputStream havent been declared.
The last link http://docs.wxwidgets.org/stable/wx_wxfiledialog.html
I dont know what to use to get information from a text file to a string:
None of them look like anything I can use to do it with.
And my c++ programming book hasn't got anything in about file input output.
I dont know enough to know whats wrong with the code I have tried, and all of it hasn't worked.
Can anyone please post a quick snippet of code that will get everything from a text file into a string?
This will really help me out, I can't do it by myself (yet), but I am right at the end of my program, and I was hoping to finish it off.