Click here to Skip to main content
15,905,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unicode, hexadecimal and japanese. Pin
samkook1-Nov-05 7:31
samkook1-Nov-05 7:31 
GeneralRe: Unicode, hexadecimal and japanese. Pin
__yb1-Nov-05 11:51
__yb1-Nov-05 11:51 
GeneralRe: Unicode, hexadecimal and japanese. Pin
samkook1-Nov-05 15:40
samkook1-Nov-05 15:40 
QuestionDebugged some strange Error and Now ??? Pin
tbrake31-Oct-05 10:04
tbrake31-Oct-05 10:04 
QuestionUPS Meant 'ActivateTopParent' Pin
tbrake31-Oct-05 10:07
tbrake31-Oct-05 10:07 
AnswerRe: Debugged some strange Error and Now ??? Pin
Joe Woodbury31-Oct-05 10:49
professionalJoe Woodbury31-Oct-05 10:49 
QuestionRe: Debugged some strange Error and Now ??? Pin
tbrake31-Oct-05 11:09
tbrake31-Oct-05 11:09 
Questionfiles Pin
Manu_8131-Oct-05 8:12
Manu_8131-Oct-05 8:12 
FILE *Ofile;

	<br />
int fCnt = 0;<br />
sprintf(gz_op_fname,"TargetStatistics%d.txt",fCnt);<br />
while ((Ofile = fopen(gz_op_fname, "r")) != NULL)<br />
{<br />
       sprintf(gz_op_fname,"TargetStatistics%d.txt",++fCnt);<br />
       fclose(Ofile);<br />
}<br />


I have the above code to create a file TargetStatistics%d.txt.
ie. if TargetStatistics0.txt, TargetStatistics1.txt already exists, then TargetStatistics2.txt will be created.

But sometimes with this code I get Invalid handle exception in the while loop.
and I occurs often when there are more files, say it has to create TargetStatistics20.txt.

Whats the problem here. Thanks in advance.
AnswerRe: files Pin
Mircea Puiu31-Oct-05 8:33
Mircea Puiu31-Oct-05 8:33 
GeneralRe: files Pin
Manu_8131-Oct-05 8:50
Manu_8131-Oct-05 8:50 
GeneralRe: files Pin
Mircea Puiu31-Oct-05 8:54
Mircea Puiu31-Oct-05 8:54 
GeneralRe: files Pin
Mircea Puiu31-Oct-05 8:56
Mircea Puiu31-Oct-05 8:56 
GeneralRe: files Pin
Manu_8131-Oct-05 9:23
Manu_8131-Oct-05 9:23 
QuestionRe: files Pin
David Crow31-Oct-05 9:19
David Crow31-Oct-05 9:19 
AnswerRe: files Pin
Manu_8131-Oct-05 9:28
Manu_8131-Oct-05 9:28 
GeneralRe: files Pin
David Crow31-Oct-05 10:01
David Crow31-Oct-05 10:01 
GeneralRe: files Pin
Manu_8131-Oct-05 10:52
Manu_8131-Oct-05 10:52 
GeneralRe: files Pin
David Crow31-Oct-05 10:59
David Crow31-Oct-05 10:59 
QuestionIMAP Pin
viliam31-Oct-05 7:25
viliam31-Oct-05 7:25 
QuestionRe: IMAP Pin
David Crow31-Oct-05 7:40
David Crow31-Oct-05 7:40 
AnswerRe: IMAP Pin
Mircea Puiu31-Oct-05 8:28
Mircea Puiu31-Oct-05 8:28 
QuestionQuestion on Listbox with tooltip support Pin
mckavity31-Oct-05 6:55
mckavity31-Oct-05 6:55 
AnswerRe: Question on Listbox with tooltip support Pin
Chris Losinger31-Oct-05 8:05
professionalChris Losinger31-Oct-05 8:05 
GeneralRe: Question on Listbox with tooltip support Pin
mckavity31-Oct-05 9:11
mckavity31-Oct-05 9:11 
QuestionEditBox &amp; Enter Pin
IndrekSnt31-Oct-05 6:02
IndrekSnt31-Oct-05 6:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.