Click here to Skip to main content
16,011,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHelp with C++ programing Pin
mimikoyan24-Mar-09 17:54
mimikoyan24-Mar-09 17:54 
AnswerRe: Help with C++ programing Pin
ThatsAlok24-Mar-09 19:52
ThatsAlok24-Mar-09 19:52 
QuestionRe: Help with C++ programing [modified] Pin
mimikoyan24-Mar-09 20:01
mimikoyan24-Mar-09 20:01 
Questionif(BOOL_b) vs if(BOOL_b == FALSE) Pin
fitatc24-Mar-09 16:24
fitatc24-Mar-09 16:24 
AnswerRe: if(BOOL_b) vs if(BOOL_b == FALSE) Pin
Maxwell Chen24-Mar-09 17:34
Maxwell Chen24-Mar-09 17:34 
AnswerRe: if(BOOL_b) vs if(BOOL_b == FALSE) Pin
N a v a n e e t h24-Mar-09 18:22
N a v a n e e t h24-Mar-09 18:22 
AnswerRe: if(BOOL_b) vs if(BOOL_b == FALSE) Pin
Eytukan24-Mar-09 19:35
Eytukan24-Mar-09 19:35 
AnswerRe: if(BOOL_b) vs if(BOOL_b == FALSE) Pin
Niklas L25-Mar-09 0:14
Niklas L25-Mar-09 0:14 
Always try to use the first form.

Checking for equality with FALSE is theoretically ok, but you can end up in trouble if you compare it with TRUE. FALSE is always zero, but any other value is 'true'.

BOOL b = 3;

if (b) {}
if (b == TRUE) {}


shows the problem. (The first if fires, but not the second one)

My advice is to use the first form, which is more elegant, and always safe.

Also think about how you name your variables, and it will be easier to read the code.


QuestionProblems using BI_BITFIELDS Compression with DrawDibDraw Pin
Uwe Kiwitt-Frischnbruder24-Mar-09 16:16
Uwe Kiwitt-Frischnbruder24-Mar-09 16:16 
QuestionProblem calling C++ DLL from Excel Pin
gvanto24-Mar-09 16:11
gvanto24-Mar-09 16:11 
AnswerRe: Problem calling C++ DLL from Excel Pin
Garth J Lancaster24-Mar-09 16:32
professionalGarth J Lancaster24-Mar-09 16:32 
QuestionRe: Problem calling C++ DLL from Excel Pin
gvanto24-Mar-09 16:38
gvanto24-Mar-09 16:38 
AnswerRe: Problem calling C++ DLL from Excel Pin
Garth J Lancaster24-Mar-09 16:48
professionalGarth J Lancaster24-Mar-09 16:48 
AnswerRe: Problem calling C++ DLL from Excel Pin
Garth J Lancaster24-Mar-09 17:19
professionalGarth J Lancaster24-Mar-09 17:19 
QuestionRe: Problem calling C++ DLL from Excel Pin
gvanto24-Mar-09 17:23
gvanto24-Mar-09 17:23 
AnswerRe: Problem calling C++ DLL from Excel Pin
Garth J Lancaster24-Mar-09 17:25
professionalGarth J Lancaster24-Mar-09 17:25 
GeneralRe: Problem calling C++ DLL from Excel Pin
gvanto24-Mar-09 17:35
gvanto24-Mar-09 17:35 
GeneralRe: Problem calling C++ DLL from Excel Pin
gvanto24-Mar-09 17:36
gvanto24-Mar-09 17:36 
GeneralRe: Problem calling C++ DLL from Excel Pin
Garth J Lancaster24-Mar-09 17:43
professionalGarth J Lancaster24-Mar-09 17:43 
QuestionMSVCR90.dll and MFCVC90.dll as part of wiseinstaller installation Pin
Ramchandra.kk24-Mar-09 15:40
Ramchandra.kk24-Mar-09 15:40 
QuestionUsing CViewmemebers , CDocumentmemebers in CWinThread Pin
Piction24-Mar-09 13:06
Piction24-Mar-09 13:06 
AnswerRe: Using CViewmemebers , CDocumentmemebers in CWinThread Pin
led mike25-Mar-09 5:16
led mike25-Mar-09 5:16 
QuestionCombination Algorithm Pin
Michael Hildebrand24-Mar-09 10:50
Michael Hildebrand24-Mar-09 10:50 
AnswerRe: Combination Algorithm Pin
led mike24-Mar-09 11:23
led mike24-Mar-09 11:23 
GeneralRe: Combination Algorithm Pin
Michael Hildebrand24-Mar-09 11:28
Michael Hildebrand24-Mar-09 11:28 

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.