fprintf allowed in main dialog?
-
All, I'm trying to do basic file I/O within the main dialog routine, the routine that all the GUI window notifications (WM_TIMER, etc.) are sent to. Is this allowed? The reason I ask is because when I try running the code I get a "Debug Assertion Failure" that states: File: fprintf Line: 56 Expression: Str != NULL I'm pretty new to Visual C++ so it may be that I just can't do file I/O there... Robert
-
All, I'm trying to do basic file I/O within the main dialog routine, the routine that all the GUI window notifications (WM_TIMER, etc.) are sent to. Is this allowed? The reason I ask is because when I try running the code I get a "Debug Assertion Failure" that states: File: fprintf Line: 56 Expression: Str != NULL I'm pretty new to Visual C++ so it may be that I just can't do file I/O there... Robert
When I go into the debugger the first argument to fprintf *str is apparently null. But, I don't open the file until a button on the GUI is pressed. The file name is based on the time that the button is hit. After opening the file I call SetTimer to fire every second at which time I try to write to the file. So, I wouldn't think that I would be writing to the file until the global variable FileOut2 gets set...
-
When I go into the debugger the first argument to fprintf *str is apparently null. But, I don't open the file until a button on the GUI is pressed. The file name is based on the time that the button is hit. After opening the file I call SetTimer to fire every second at which time I try to write to the file. So, I wouldn't think that I would be writing to the file until the global variable FileOut2 gets set...
So what happens first,
fopen()
orfprintf()
?
A rich person is not the one who has the most, but the one that needs the least.