Click here to Skip to main content
15,920,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Knowing mouse state? Pin
Andrew Walker21-Jul-04 2:20
Andrew Walker21-Jul-04 2:20 
GeneralCTreeCtrl and CheckBox Pin
amit_k_gupta21-Jul-04 1:47
amit_k_gupta21-Jul-04 1:47 
GeneralRe: CTreeCtrl and CheckBox Pin
David Crow21-Jul-04 6:54
David Crow21-Jul-04 6:54 
Generalinsert bitmap into toolbar(Dialog based App) Pin
mvnevis21-Jul-04 1:28
mvnevis21-Jul-04 1:28 
GeneralOpening a File in SDI Pin
cheenu_200221-Jul-04 1:23
cheenu_200221-Jul-04 1:23 
GeneralRe: Opening a File in SDI Pin
David Crow21-Jul-04 6:58
David Crow21-Jul-04 6:58 
GeneralRe: Opening a File in SDI Pin
cheenu_200222-Jul-04 0:54
cheenu_200222-Jul-04 0:54 
GeneralRe: Opening a File in SDI Pin
David Crow22-Jul-04 2:23
David Crow22-Jul-04 2:23 
cheenu_2002 wrote:
How can I read the binary data bit by bit?

I'm not sure, but if you want to read it one byte at a time, try:

CFile file("myfile.dat", CFile::modeRead);
BYTE buffer;
while (file.Read(&buffer, sizeof(buffer)) > 0)
    ; // do something with 'buffer'
However, you should note that this approach is very inefficient for medium to large files. A better approach would be:

CFile file("myfile.dat", CFile::modeRead);
BYTE buffer[1024];
UINT uBytesRead;
while ((uBytesRead = file.Read(buffer, sizeof(buffer))) > 0)
{
    for (UINT uIndex = 0; uIndex < uBytesRead; uIndex++)
        ; // do something with 'buffer[uIndex]'
}
This should give you the idea that less disk I/O results in increased performance.


"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen


GeneralWhere is &quot;%_WINCEROOT%\Public\Common\Oak\Drivers\Bluetooth\Sample\Sca&quot; Pin
LittleYellowBird21-Jul-04 1:12
LittleYellowBird21-Jul-04 1:12 
GeneralAttach to process - Timing issue.. Pin
TssPrasad21-Jul-04 0:39
sussTssPrasad21-Jul-04 0:39 
QuestionHow do I attach 3 Dialogs with HTML support using CPropertyPage class or anotherclass Pin
pubududilena21-Jul-04 0:29
pubududilena21-Jul-04 0:29 
AnswerRe: How do I attach 3 Dialogs with HTML support using CPropertyPage class or anotherclass Pin
Antti Keskinen21-Jul-04 3:40
Antti Keskinen21-Jul-04 3:40 
QuestionHow do I attach 3 Dialogs with HTML support using CPropertyPage class or anotherclass Pin
pubududilena21-Jul-04 0:28
pubududilena21-Jul-04 0:28 
QuestionHow do I show 3 Dialogs with HTML support using CPropertyPage(like excel sheet) Pin
pubududilena21-Jul-04 0:24
pubududilena21-Jul-04 0:24 
Questionscanf up to tab? Pin
Dominik Reichl20-Jul-04 22:44
Dominik Reichl20-Jul-04 22:44 
AnswerRe: scanf up to tab? Pin
Bhaskar20-Jul-04 23:54
Bhaskar20-Jul-04 23:54 
GeneralRe: scanf up to tab? Pin
Harold Bamford23-Jul-04 11:11
Harold Bamford23-Jul-04 11:11 
GeneralRe: scanf up to tab? Pin
Bhaskar23-Jul-04 21:19
Bhaskar23-Jul-04 21:19 
GeneralRe: scanf up to tab? Pin
Harold Bamford26-Jul-04 7:21
Harold Bamford26-Jul-04 7:21 
GeneralIcon in a minimized APP with a thin dialog Pin
doctorpi20-Jul-04 21:54
doctorpi20-Jul-04 21:54 
Generalfast algorithm linear correlation coeffcient Pin
Anonymous20-Jul-04 21:23
Anonymous20-Jul-04 21:23 
GeneralChanging color of a Button Pin
M Ashok Kumar20-Jul-04 21:19
M Ashok Kumar20-Jul-04 21:19 
GeneralRe: Changing color of a Button Pin
Antti Keskinen20-Jul-04 22:49
Antti Keskinen20-Jul-04 22:49 
GeneralRe: Changing color of a Button Pin
umair_hasan20-Jul-04 23:39
umair_hasan20-Jul-04 23:39 
GeneralRe: Changing color of a Button Pin
Ravi Bhavnani21-Jul-04 3:00
professionalRavi Bhavnani21-Jul-04 3:00 

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.