Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Effect Class Pin
Mark Salsbery2-Jul-07 12:32
Mark Salsbery2-Jul-07 12:32 
GeneralRe: Effect Class Pin
Perspx2-Jul-07 22:01
Perspx2-Jul-07 22:01 
GeneralRe: Effect Class Pin
Mark Salsbery3-Jul-07 5:53
Mark Salsbery3-Jul-07 5:53 
QuestionHow can I ensure that a drive is spinning and ready to write data? Pin
TragicComic2-Jul-07 10:53
TragicComic2-Jul-07 10:53 
AnswerRe: How can I ensure that a drive is spinning and ready to write data? Pin
David Crow2-Jul-07 15:07
David Crow2-Jul-07 15:07 
AnswerRe: How can I ensure that a drive is spinning and ready to write data? Pin
Stephen Hewitt2-Jul-07 15:08
Stephen Hewitt2-Jul-07 15:08 
AnswerRe: How can I ensure that a drive is spinning and ready to write data? Pin
Nuxser2-Jul-07 22:19
Nuxser2-Jul-07 22:19 
Questionstring help Pin
dellthinker2-Jul-07 10:52
dellthinker2-Jul-07 10:52 
Hi all, im having trouble with the following code:

<br />
void read(void){<br />
	const int buffer4=900;<br />
	char buffer[BUFSIZ]={'\0'};<br />
	char sysfolder4[buffer4];<br />
	ifstream file;<br />
	ExpandEnvironmentStrings("%systemroot%\\file.txt", sysfolder4, buffer4);<br />
	file.open(sysfolder4, ios::in);<br />
	if(file.fail()){<br />
		msg = "PRIVMSG " + chan1 + " file is not detected..\n";<br />
		SendToServer(msg.c_str());<br />
	}<br />
	else{<br />
		msg = "PRIVMSG " + chan1 + " Listing file..\n";<br />
		SendToServer(msg.c_str());<br />
		while(file.getline(buffer, BUFSIZ)){<br />
		Sleep(500);<br />
		msg = "\r\nPRIVMSG " + chan1 + " :" + buffer;  // ***<br />
		SendToServer(msg.c_str());<br />
		}<br />
		file.close();<br />
		msg = "\nPRIVMSG " + chan1 + " :End of file.";<br />
		SendToServer(msg.c_str());<br />
	}<br />
}<br />


Its suppose to read a file, and close when its done reading the file. However it reads the file, and finishes at the very last line, but stops until another command is entered and prints something un-wanted.

Here's what i'd like to happen.
<quote>
[master] list sample
[ client ] sample random text file.
[ client ] test file reading.
[ client ] read.
[ client ] End of file.


And here's what happens instead.

<quote>
[master] list sample
[ client ] sample random text file.
[ client ] test file reading.
[ client ] read.
[ master ] test
[ client ] End of file.PRIVMSG #chan :This is only a test


Can anyone tell me what could be wrong?? I've tried escape characters but they dont seem to do much, what could be wrong with the string buffer? Any help would be appreciated, thanx in advance!
AnswerRe: string help Pin
_anil_2-Jul-07 14:30
_anil_2-Jul-07 14:30 
QuestionHow to declare a variable of type CRITICAL_SECTION Pin
zipliu2-Jul-07 10:18
zipliu2-Jul-07 10:18 
AnswerRe: How to declare a variable of type CRITICAL_SECTION Pin
zipliu2-Jul-07 10:19
zipliu2-Jul-07 10:19 
AnswerRe: How to declare a variable of type CRITICAL_SECTION Pin
David Crow2-Jul-07 10:49
David Crow2-Jul-07 10:49 
AnswerRe: How to declare a variable of type CRITICAL_SECTION Pin
Mark Salsbery2-Jul-07 12:43
Mark Salsbery2-Jul-07 12:43 
QuestionVariants Pin
tom groezer2-Jul-07 9:24
tom groezer2-Jul-07 9:24 
AnswerRe: Variants Pin
David Crow2-Jul-07 9:41
David Crow2-Jul-07 9:41 
QuestionMFC frame Pin
tom groezer2-Jul-07 9:16
tom groezer2-Jul-07 9:16 
AnswerRe: MFC frame Pin
Mark Salsbery2-Jul-07 9:39
Mark Salsbery2-Jul-07 9:39 
QuestionWindow registeration Pin
tom groezer2-Jul-07 9:00
tom groezer2-Jul-07 9:00 
AnswerRe: Window registeration Pin
David Crow2-Jul-07 9:48
David Crow2-Jul-07 9:48 
AnswerRe: Window registeration Pin
Mark Salsbery2-Jul-07 9:49
Mark Salsbery2-Jul-07 9:49 
QuestionVMR9 & SampleGrabber at the same time , how ? Pin
Akin Ocal2-Jul-07 8:51
Akin Ocal2-Jul-07 8:51 
AnswerRe: VMR9 & SampleGrabber at the same time , how ? Pin
Mark Salsbery2-Jul-07 9:30
Mark Salsbery2-Jul-07 9:30 
GeneralRe: VMR9 & SampleGrabber at the same time , how ? Pin
Akin Ocal2-Jul-07 11:27
Akin Ocal2-Jul-07 11:27 
GeneralRe: VMR9 & SampleGrabber at the same time , how ? Pin
Mark Salsbery2-Jul-07 12:28
Mark Salsbery2-Jul-07 12:28 
QuestionWhat is dlg subclass ? Pin
prithaa2-Jul-07 8:21
prithaa2-Jul-07 8:21 

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.