Click here to Skip to main content
16,006,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: If you are only running on Windows 98 or later, you can use SendInput, which can even simulate another hardware input events Pin
Daniel Turini23-Sep-02 8:37
Daniel Turini23-Sep-02 8:37 
GeneralRe: If you are only running on Windows 98 or later, you can use SendInput, which can even simulate another hardware input events Pin
Xia yingqiang24-Sep-02 5:41
Xia yingqiang24-Sep-02 5:41 
GeneralMulticast .... Pin
User 988523-Sep-02 5:18
User 988523-Sep-02 5:18 
GeneralRe: Multicast .... Pin
Mike Nordell23-Sep-02 8:24
Mike Nordell23-Sep-02 8:24 
GeneralRe: Multicast .... Pin
User 988523-Sep-02 8:33
User 988523-Sep-02 8:33 
GeneralTrouble reading files...CFile:Read Pin
merc23-Sep-02 5:00
merc23-Sep-02 5:00 
GeneralRe: Trouble reading files...CFile:Read Pin
jmkhael23-Sep-02 5:32
jmkhael23-Sep-02 5:32 
GeneralRe: Trouble reading files...CFile:Read Pin
merc23-Sep-02 6:34
merc23-Sep-02 6:34 
So, Papa, how do I make sure the end of file has been reached? Still from the number of bytes returned from reading, right? But, my problem is that my buffer reads and loads "" into it..more likely, it loads nothing in the buffer.

void MyClass::Read(CString sFilename)
{
BYTE *pBuf = new BYTE[4096];
CFile pFile (sFilename, CFile::modeRead); //tried
//CFile::typeBinary too
int iReadSize = 0;
while(true){
iReadSize = pFile.Read(pBuf, 4096);
if(iReadSize == 0)
break;
else{
//my processing goes here
}
}
pFile.Close();
}

Thanks,
JJ

GeneralRe: Trouble reading files...CFile:Read Pin
jmkhael23-Sep-02 7:09
jmkhael23-Sep-02 7:09 
GeneralRe: Trouble reading files...CFile:Read Pin
Neville Franks23-Sep-02 5:37
Neville Franks23-Sep-02 5:37 
GeneralRe: Trouble reading files...CFile:Read Pin
merc23-Sep-02 6:38
merc23-Sep-02 6:38 
GeneralRe: Trouble reading files...CFile:Read Pin
Neville Franks23-Sep-02 11:47
Neville Franks23-Sep-02 11:47 
GeneralRe: Trouble reading files...CFile:Read Pin
merc24-Sep-02 7:27
merc24-Sep-02 7:27 
GeneralRe: Trouble reading files...CFile:Read Pin
Todd Smith23-Sep-02 6:18
Todd Smith23-Sep-02 6:18 
GeneralRe: Trouble reading files...CFile:Read Pin
merc23-Sep-02 6:40
merc23-Sep-02 6:40 
Generaladding chm help file to project Pin
Hel23-Sep-02 4:53
Hel23-Sep-02 4:53 
GeneralRe: adding chm help file to project Pin
Pavel Klocek23-Sep-02 5:23
Pavel Klocek23-Sep-02 5:23 
GeneralRe: adding chm help file to project Pin
Hel23-Sep-02 5:27
Hel23-Sep-02 5:27 
GeneralRe: adding chm help file to project: File missing at link Pin
ns23-Sep-02 5:46
ns23-Sep-02 5:46 
GeneralRe: adding chm help file to project: File missing at link Pin
Hel23-Sep-02 6:32
Hel23-Sep-02 6:32 
GeneralRe: adding chm help file to project: File missing at link Pin
Pavel Klocek23-Sep-02 8:48
Pavel Klocek23-Sep-02 8:48 
GeneralRe: adding chm help file to project: File missing at link Pin
ns23-Sep-02 9:53
ns23-Sep-02 9:53 
Generalcreate Browse For Folder dialog box Pin
tomc23-Sep-02 4:38
tomc23-Sep-02 4:38 
GeneralRe: create Browse For Folder dialog box Pin
Bing Ding23-Sep-02 4:42
Bing Ding23-Sep-02 4:42 
GeneralRe: create Browse For Folder dialog box Pin
Pavel Klocek23-Sep-02 5:32
Pavel Klocek23-Sep-02 5:32 

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.