Click here to Skip to main content
15,900,973 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to convert CString to int MFC 7.1 Pin
Mark Salsbery11-Mar-07 8:59
Mark Salsbery11-Mar-07 8:59 
Questionneed help on detecting the insertion of a USB device Pin
sowhat_8210-Mar-07 8:56
sowhat_8210-Mar-07 8:56 
AnswerRe: need help on detecting the insertion of a USB device Pin
prasad_som10-Mar-07 18:15
prasad_som10-Mar-07 18:15 
QuestionPredefined Macros Pin
sawerr10-Mar-07 8:49
sawerr10-Mar-07 8:49 
AnswerRe: Predefined Macros Pin
Waldermort10-Mar-07 18:12
Waldermort10-Mar-07 18:12 
GeneralRe: Predefined Macros Pin
sawerr10-Mar-07 22:07
sawerr10-Mar-07 22:07 
GeneralRe: Predefined Macros Pin
toxcct10-Mar-07 23:05
toxcct10-Mar-07 23:05 
AnswerRe: Predefined Macros Pin
toxcct11-Mar-07 0:04
toxcct11-Mar-07 0:04 
what WalderMort doesn't say, is that your life can become a nightmare if you come to debug your SUM() macro:
#define SUM(a,b,c) a + b + c

when you define a macro, your first reflex should be to worry about operators precedence. Here is an exemple:
float f = SUM(2, 2, 2) * 5;

you're expecting f to be 30 (6 * 5), right ?
but here is how the compiler treats your macro expansion:
float f = 2 + 2 + 2 * 5;

and as you propably know, multiplication operator is more prioritary over addition, so f actually gets :
float f = 2 + 2 + (2 * 5);   // f = 14

so don't forget parenthesis when defining macros, ever !!!
#define SUM(a,b,c) <code>(</code>a + b + c<code>)</code>




QuestionHow to Remove the Title bar of Window created through CreateWindowEx... Pin
nagamohan_p10-Mar-07 6:30
nagamohan_p10-Mar-07 6:30 
AnswerRe: How to Remove the Title bar of Window created through CreateWindowEx... Pin
Mark Salsbery10-Mar-07 6:45
Mark Salsbery10-Mar-07 6:45 
QuestionCertification in C++ or VC++ Pin
vibindia10-Mar-07 2:05
vibindia10-Mar-07 2:05 
AnswerRe: Certification in C++ or VC++ Pin
Waldermort10-Mar-07 3:13
Waldermort10-Mar-07 3:13 
AnswerRe: Certification in C++ or VC++ Pin
Kevin McFarlane10-Mar-07 5:10
Kevin McFarlane10-Mar-07 5:10 
QuestionVisual C++ vs C++.Net Pin
Software_Specialist10-Mar-07 1:54
Software_Specialist10-Mar-07 1:54 
AnswerRe: Visual C++ vs C++.Net Pin
Waldermort10-Mar-07 3:14
Waldermort10-Mar-07 3:14 
AnswerRe: Visual C++ vs C++.Net Pin
George L. Jackson10-Mar-07 3:25
George L. Jackson10-Mar-07 3:25 
GeneralRe: Visual C++ vs C++.Net Pin
Pan San10-Mar-07 22:19
Pan San10-Mar-07 22:19 
GeneralRe: Visual C++ vs C++.Net Pin
toxcct11-Mar-07 0:09
toxcct11-Mar-07 0:09 
GeneralRe: Visual C++ vs C++.Net Pin
Eytukan11-Mar-07 0:17
Eytukan11-Mar-07 0:17 
GeneralRe: Visual C++ vs C++.Net Pin
Eytukan11-Mar-07 0:18
Eytukan11-Mar-07 0:18 
GeneralRe: Visual C++ vs C++.Net Pin
George L. Jackson11-Mar-07 2:34
George L. Jackson11-Mar-07 2:34 
GeneralRe: Visual C++ vs C++.Net Pin
Pan San13-Mar-07 23:19
Pan San13-Mar-07 23:19 
AnswerRe: Visual C++ vs C++.Net Pin
Christian Graus10-Mar-07 9:02
protectorChristian Graus10-Mar-07 9:02 
GeneralRe: Visual C++ vs C++.Net Pin
Software_Specialist10-Mar-07 11:49
Software_Specialist10-Mar-07 11:49 
GeneralRe: Visual C++ vs C++.Net Pin
Eytukan10-Mar-07 18:18
Eytukan10-Mar-07 18:18 

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.