Click here to Skip to main content
15,910,586 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCreating Visual Studio6.0 add-in Pin
Bob Stanneveld8-Sep-04 10:06
Bob Stanneveld8-Sep-04 10:06 
GeneralBrute Force Pin
RedDragon2k8-Sep-04 9:25
RedDragon2k8-Sep-04 9:25 
GeneralRe: Brute Force Pin
Chris Losinger8-Sep-04 9:27
professionalChris Losinger8-Sep-04 9:27 
GeneralBit stuff Pin
Timothy Grabrian8-Sep-04 8:50
professionalTimothy Grabrian8-Sep-04 8:50 
GeneralRe: Bit stuff Pin
Timothy Grabrian8-Sep-04 8:56
professionalTimothy Grabrian8-Sep-04 8:56 
GeneralRe: Bit stuff Pin
Chris Losinger8-Sep-04 9:24
professionalChris Losinger8-Sep-04 9:24 
GeneralRe: Bit stuff Pin
Bob Stanneveld8-Sep-04 9:50
Bob Stanneveld8-Sep-04 9:50 
GeneralRe: Bit stuff Pin
Chris Losinger8-Sep-04 10:07
professionalChris Losinger8-Sep-04 10:07 
Bob Stanneveld wrote:
Why would you define such macros?

because you might be looking at individual bits for purposes other than testing pre-defined flags. and, it helps reduce errors like this:

// this...
if (data & BIT_POSITION_VALUE == BIT_POSITION_VALUE)
{
...
}

// is not the same as this.
if ((data & BIT_POSITION_VALUE) == BIT_POSITION_VALUE)
{
...
}


Bob Stanneveld wrote:
This way, you'll save some CPU cycles and you can define more flags

there's no CPU savings there (except perhaps a micro-second worth of compiler time), because the pre-processor will turn that macro into code identical to what you show.


Software | Cleek

GeneralRe: Bit stuff Pin
PJ Arends8-Sep-04 16:21
professionalPJ Arends8-Sep-04 16:21 
GeneralCDialog and taskkbar Pin
?!?8-Sep-04 8:19
?!?8-Sep-04 8:19 
GeneralMFC newbie question Pin
Anonymous8-Sep-04 8:14
Anonymous8-Sep-04 8:14 
GeneralRe: MFC newbie question Pin
David Crow8-Sep-04 9:05
David Crow8-Sep-04 9:05 
Generalincoming connection with ras api Pin
mark1828-Sep-04 6:55
mark1828-Sep-04 6:55 
QuestionHourglass Animation? Pin
Joel Holdsworth8-Sep-04 6:24
Joel Holdsworth8-Sep-04 6:24 
AnswerRe: Hourglass Animation? Pin
DRHuff8-Sep-04 6:48
DRHuff8-Sep-04 6:48 
GeneralRe: Hourglass Animation? Pin
Joel Holdsworth8-Sep-04 7:07
Joel Holdsworth8-Sep-04 7:07 
GeneralRe: Hourglass Animation? Pin
David Crow8-Sep-04 8:40
David Crow8-Sep-04 8:40 
AnswerRe: Hourglass Animation? Pin
Graham Bradshaw8-Sep-04 13:00
Graham Bradshaw8-Sep-04 13:00 
GeneralI've shown the dialog, now I can't interact with it. Pin
BlackDice8-Sep-04 6:16
BlackDice8-Sep-04 6:16 
GeneralWM_HSCROLL doesn't work on custom sliders Pin
Budric B.8-Sep-04 6:05
Budric B.8-Sep-04 6:05 
GeneralRe: WM_HSCROLL doesn't work on custom sliders Pin
Anonymous8-Sep-04 6:44
Anonymous8-Sep-04 6:44 
GeneralADO, Winsock, Client/Server Pin
Kudakwashe Mafutah8-Sep-04 5:58
Kudakwashe Mafutah8-Sep-04 5:58 
QuestionHow can I show a dialog on top of a screensaver? Pin
BlackDice8-Sep-04 4:20
BlackDice8-Sep-04 4:20 
GeneralSingle thread to multi-thread conversion problem Pin
vineas8-Sep-04 4:02
vineas8-Sep-04 4:02 
GeneralRe: Single thread to multi-thread conversion problem Pin
Neville Franks8-Sep-04 10:32
Neville Franks8-Sep-04 10: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.