Thread: wxFile problem
View Single Post
Old Aug 25th, 2007, 6:43 AM   #4
dr.p
Programmer
 
dr.p's Avatar
 
Join Date: Feb 2006
Location: Ohio
Posts: 93
Rep Power: 3 dr.p is on a distinguished road
You need to use wxFile::write as the second parameter to your wxFile constructor call, since the file is opened in read mode by default.

e.g.
wxFile *file_to_write_to = new wxFile(WxEdit1->GetLineText(0).c_str(), wxFile::write);

Your error message probably changed, by the way, because you didn't explicitly identify your c_str as a const char *. It looks like it's being interpreted as an integer, so you're actually calling the secondary constructor, which requires an integer value that identifies the file descriptor.

Check out the wxFile class in the widget docs for more details. You can download the docs from the wxWidget web site in a number of formats to have handy.
__________________
Neeley.org
dr.p is offline   Reply With Quote