Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: integer to string? Pin
Pacificat0r7-Mar-06 10:52
Pacificat0r7-Mar-06 10:52 
QuestionPorting from WinInet to WinHttp 5.1 Pin
shaylin5-Mar-06 2:02
shaylin5-Mar-06 2:02 
Questionreading a string from an unknown position in a file Pin
SWDevil5-Mar-06 1:30
SWDevil5-Mar-06 1:30 
AnswerRe: reading a string from an unknown position in a file Pin
Gary R. Wheeler5-Mar-06 2:13
Gary R. Wheeler5-Mar-06 2:13 
GeneralRe: reading a string from an unknown position in a file Pin
SWDevil5-Mar-06 2:27
SWDevil5-Mar-06 2:27 
GeneralRe: reading a string from an unknown position in a file Pin
Gary R. Wheeler5-Mar-06 2:53
Gary R. Wheeler5-Mar-06 2:53 
GeneralRe: reading a string from an unknown position in a file Pin
Stephen Hewitt5-Mar-06 17:13
Stephen Hewitt5-Mar-06 17:13 
GeneralRe: reading a string from an unknown position in a file Pin
SWDevil5-Mar-06 20:06
SWDevil5-Mar-06 20:06 
I didn't use the loop. I used the strstr function in a different loop, but I think I have an infinite loop. This is my code:

CFile cf(sCurrImgPath, CFile::modeRead);
const int MaxBufferSize = 100000;
char cTemp[MaxBufferSize + 1];

while (pStr == NULL)
{
iBytesRead = cf.Read(cTemp, MaxBufferSize);
pStr = strstr(cTemp, "<>");
}

My file is about 2200KB, so if I'm reading 100,000 bytes each iteration , then there should be about 22 iterations.
The problem is that it keeps going much further than 22 iterations, and doesn't read anymore data. it keeps going because pStr is still NULL because the string isn't found in CTemp...

any ideas?

GeneralRe: reading a string from an unknown position in a file Pin
Stephen Hewitt5-Mar-06 20:24
Stephen Hewitt5-Mar-06 20:24 
GeneralRe: reading a string from an unknown position in a file Pin
SWDevil5-Mar-06 20:52
SWDevil5-Mar-06 20:52 
GeneralRe: reading a string from an unknown position in a file Pin
Stephen Hewitt5-Mar-06 20:56
Stephen Hewitt5-Mar-06 20:56 
GeneralRe: reading a string from an unknown position in a file Pin
SWDevil5-Mar-06 21:24
SWDevil5-Mar-06 21:24 
GeneralRe: reading a string from an unknown position in a file Pin
Stephen Hewitt5-Mar-06 21:32
Stephen Hewitt5-Mar-06 21:32 
GeneralRe: reading a string from an unknown position in a file Pin
SWDevil5-Mar-06 21:37
SWDevil5-Mar-06 21:37 
GeneralRe: reading a string from an unknown position in a file Pin
Stephen Hewitt5-Mar-06 21:47
Stephen Hewitt5-Mar-06 21:47 
GeneralRe: reading a string from an unknown position in a file Pin
SWDevil5-Mar-06 21:53
SWDevil5-Mar-06 21:53 
GeneralRe: reading a string from an unknown position in a file Pin
Gary R. Wheeler6-Mar-06 12:41
Gary R. Wheeler6-Mar-06 12:41 
QuestionRe: reading a string from an unknown position in a file Pin
David Crow6-Mar-06 3:18
David Crow6-Mar-06 3:18 
AnswerRe: reading a string from an unknown position in a file Pin
Gary R. Wheeler6-Mar-06 12:44
Gary R. Wheeler6-Mar-06 12:44 
AnswerRe: reading a string from an unknown position in a file Pin
David Crow6-Mar-06 3:15
David Crow6-Mar-06 3:15 
QuestionA beginners question about UINT Pin
Waldermort5-Mar-06 1:04
Waldermort5-Mar-06 1:04 
AnswerRe: A beginners question about UINT Pin
Justin Tay5-Mar-06 1:20
Justin Tay5-Mar-06 1:20 
GeneralRe: A beginners question about UINT Pin
Waldermort5-Mar-06 1:51
Waldermort5-Mar-06 1:51 
QuestionReal time audio capture and processing Pin
toolboxx4-Mar-06 23:06
toolboxx4-Mar-06 23:06 
AnswerRe: Real time audio capture and processing Pin
mikanu5-Mar-06 10:14
mikanu5-Mar-06 10:14 

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.