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.
My task is simple: I need to open a text file and write some stuff to it. I was able to do this in the command line with fstream but now in wxwidgets, I am having a lot of trouble.
Can somebody help me here?
Bonus Awesomeness (Not required): If you can show me how to follow the following pseudo code that would be great:
Check if file exists
If not:
Create file
Write initial data
Make file remain open for editing
If so:
Open file for editing
End Check
Write a line (skipping to a new one with \n)
npsken wrote:My task is simple: I need to open a text file and write some stuff to it. I was able to do this in the command line with fstream but now in wxwidgets, I am having a lot of trouble.
Can somebody help me here?
Bonus Awesomeness (Not required): If you can show me how to follow the following pseudo code that would be great:
Check if file exists
If not:
Create file
Write initial data
Make file remain open for editing
If so:
Open file for editing
End Check
Write a line (skipping to a new one with \n)
npsken wrote:(This code is within a button void) nothing happens.
If this is where the code is why don't you show that code aren't you showing that code as well. Your event tables etc... Since the code there isn't being run it would be a good assumption to check that the event handler isn't being called.
npsken wrote:(This code is within a button void) nothing happens.
If this is where the code is why don't you show that code aren't you showing that code as well. Your event tables etc... Since the code there isn't being run it would be a good assumption to check that the event handler isn't being called.
-Max
I actually knew that it was working because the button also does something else right before the file stuff.
Anyway, I tried Auria's code and it wouldn't work BUT it started working when I used the actual executable that was made rather than using the run menu from codeblocks.