Click here to Skip to main content
15,503,850 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Difficulty in getting iterator upon using find algorithm of STL Pin
Jochen Arndt26-Feb-16 3:43
professionalJochen Arndt26-Feb-16 3:43 
GeneralRe: Difficulty in getting iterator upon using find algorithm of STL Pin
Member 123535317-Mar-16 20:23
Member 123535317-Mar-16 20:23 
GeneralRe: Difficulty in getting iterator upon using find algorithm of STL Pin
Jochen Arndt7-Mar-16 22:41
professionalJochen Arndt7-Mar-16 22:41 
QuestionDLL Features Pin
bkelly1324-Feb-16 13:53
bkelly1324-Feb-16 13:53 
AnswerRe: DLL Features Pin
Jochen Arndt24-Feb-16 22:24
professionalJochen Arndt24-Feb-16 22:24 
AnswerRe: DLL Features Pin
Richard MacCutchan24-Feb-16 22:34
mveRichard MacCutchan24-Feb-16 22:34 
Questioncontrol #define directive Pin
p3im4n24-Feb-16 5:34
p3im4n24-Feb-16 5:34 
SuggestionRe: control #define directive Pin
Jochen Arndt24-Feb-16 5:57
professionalJochen Arndt24-Feb-16 5:57 
Please explain your problem using an example. It is (at least for me) unclear.

Common practice is to define a value somewhere (inside a header file or even passing it to the compiler via command line; optionally by project settings).

So assuming you use ACTIVE as boolean condition (defined or not defined):

C++
// General header file
// Comment this to undefine
#define ACTIVE

C++
// Any other file that has included above header file
#ifdef ACTION
// Do something
#endif

#ifndef ACTION
// Do something else
#endif

But this won't work if there is a code condition like
C++
if (condition) 

Then you have to use similar code conditions in all other places.

Note also that I have used all upper case for the defined value because this is common practice.

To know about conditional inclusions using the preprocessor see Preprocessor directives - C++ Tutorials[^].
AnswerRe: control #define directive Pin
Richard MacCutchan24-Feb-16 9:25
mveRichard MacCutchan24-Feb-16 9:25 
QuestionAssertion From SendNotifyMessage Pin
ForNow24-Feb-16 4:28
ForNow24-Feb-16 4:28 
AnswerRe: Assertion From SendNotifyMessage Pin
Jochen Arndt24-Feb-16 4:50
professionalJochen Arndt24-Feb-16 4:50 
GeneralRe: Assertion From SendNotifyMessage Pin
ForNow24-Feb-16 6:45
ForNow24-Feb-16 6:45 
QuestionRe: Assertion From SendNotifyMessage Pin
Richard MacCutchan24-Feb-16 5:00
mveRichard MacCutchan24-Feb-16 5:00 
AnswerRe: Assertion From SendNotifyMessage Pin
ForNow24-Feb-16 6:47
ForNow24-Feb-16 6:47 
GeneralRe: Assertion From SendNotifyMessage Pin
Richard MacCutchan24-Feb-16 6:50
mveRichard MacCutchan24-Feb-16 6:50 
GeneralRe: Assertion From SendNotifyMessage Pin
ForNow24-Feb-16 7:04
ForNow24-Feb-16 7:04 
GeneralRe: Assertion From SendNotifyMessage Pin
Richard MacCutchan24-Feb-16 7:10
mveRichard MacCutchan24-Feb-16 7:10 
GeneralRe: Assertion From SendNotifyMessage Pin
ForNow24-Feb-16 9:07
ForNow24-Feb-16 9:07 
GeneralRe: Assertion From SendNotifyMessage Pin
Richard MacCutchan24-Feb-16 9:22
mveRichard MacCutchan24-Feb-16 9:22 
GeneralRe: Assertion From SendNotifyMessage Pin
ForNow24-Feb-16 13:45
ForNow24-Feb-16 13:45 
GeneralRe: Assertion From SendNotifyMessage Pin
Richard MacCutchan24-Feb-16 22:16
mveRichard MacCutchan24-Feb-16 22:16 
GeneralRe: Assertion From SendNotifyMessage Pin
ForNow25-Feb-16 7:18
ForNow25-Feb-16 7:18 
GeneralRe: Assertion From SendNotifyMessage Pin
Richard MacCutchan25-Feb-16 7:31
mveRichard MacCutchan25-Feb-16 7:31 
QuestionUsing ShellExecute or CreateProcess caller lose its focus Pin
sdancer7523-Feb-16 9:30
sdancer7523-Feb-16 9:30 
AnswerRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Richard Andrew x6423-Feb-16 11:22
professionalRichard Andrew x6423-Feb-16 11:22 

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.