Click here to Skip to main content
15,891,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralText Wrap in Static control Pin
Pushkar Tamboli8-Dec-04 19:53
Pushkar Tamboli8-Dec-04 19:53 
GeneralRe: Text Wrap in Static control Pin
A T I F8-Dec-04 20:39
A T I F8-Dec-04 20:39 
GeneralRe: Text Wrap in Static control Pin
Pushkar Tamboli8-Dec-04 22:20
Pushkar Tamboli8-Dec-04 22:20 
GeneralRe: Text Wrap in Static control Pin
namaskaaram8-Dec-04 23:37
namaskaaram8-Dec-04 23:37 
Questioncheck box could be owner draw? Pin
lowiq8-Dec-04 19:51
lowiq8-Dec-04 19:51 
GeneralMarcos in MFC Pin
Amit Mulay8-Dec-04 19:16
Amit Mulay8-Dec-04 19:16 
GeneralRe: Marcos in MFC Pin
alex.barylski8-Dec-04 19:19
alex.barylski8-Dec-04 19:19 
GeneralRe: Marcos in MFC Pin
toxcct8-Dec-04 22:08
toxcct8-Dec-04 22:08 
macros are #defines, that means that the preprocessor copies its definition where the macro was called, like inline functions are.

but BE CAREFUL, macros can be very bad. consider the following :
<font color=#0000FF>#define</font> INCRZ(xx) xx + 1

if you then call this :
<font color=#0000FF>int</font> i = 2;
INCRZ(2);     <font color=#008000>// i == 3, OK</font>

OK, i == 3 at the end.
and what about this ? :
<font color=#0000FF>int</font> i = 2;
i = 5 * INCRZ(i)<font color=#008000>    // i == 11, BAD !!!</font>

BAD CODE !! here is how the preprocessor inlines the macro :
i = 5 * i + 1;
At the end, i is evaluated as : i = (5 * i) + 1; because you might know that multiplication is prior on addition.
be careful so when designing macros, and put a maximum af parenthesis :
<font color=#0000FF>#define</font> INCRZ(xx) ((xx) + 1)



TOXCCT >>> GEII power
[toxcct][VisualCalc]
GeneralPlease clear this doubt Pin
Sreekanth Muralidharan8-Dec-04 16:40
Sreekanth Muralidharan8-Dec-04 16:40 
GeneralPicking transparent color from a gif Pin
Abin8-Dec-04 16:30
Abin8-Dec-04 16:30 
GeneralCMapStringToOb :: lookup() Pin
Anonymous8-Dec-04 16:25
Anonymous8-Dec-04 16:25 
GeneralRe: CMapStringToOb :: lookup() Pin
RChin8-Dec-04 22:42
RChin8-Dec-04 22:42 
GeneralFile dialog Office 2003 style Pin
Gagnon Claude8-Dec-04 16:05
Gagnon Claude8-Dec-04 16:05 
GeneralGettin an error... Pin
Pheonix288-Dec-04 15:36
sussPheonix288-Dec-04 15:36 
GeneralRe: Gettin an error... Pin
Tom Wright8-Dec-04 16:19
Tom Wright8-Dec-04 16:19 
GeneralRe: Gettin an error... Pin
bryce8-Dec-04 17:46
bryce8-Dec-04 17:46 
GeneralRe: Gettin an error... Pin
Cedric Moonen8-Dec-04 22:24
Cedric Moonen8-Dec-04 22:24 
General2 ?'s Pin
3dman8-Dec-04 15:10
3dman8-Dec-04 15:10 
GeneralRe: 2 ?'s Pin
Maximilien8-Dec-04 15:22
Maximilien8-Dec-04 15:22 
Generalremove an icon from the status tray (system tray) Pin
Tom Wright8-Dec-04 14:44
Tom Wright8-Dec-04 14:44 
GeneralHelp with Strtok Pin
civicnar8-Dec-04 13:43
civicnar8-Dec-04 13:43 
GeneralRe: Help with Strtok Pin
Christian Graus8-Dec-04 13:47
protectorChristian Graus8-Dec-04 13:47 
GeneralRe: Help with Strtok Pin
civicnar8-Dec-04 15:17
civicnar8-Dec-04 15:17 
GeneralRe: Help with Strtok Pin
Blake Miller9-Dec-04 3:49
Blake Miller9-Dec-04 3:49 
GeneralCListCtrl Item Height Pin
Blake Miller8-Dec-04 12:46
Blake Miller8-Dec-04 12:46 

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.