Click here to Skip to main content
15,894,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Missing "type specifier " ? Pin
RedDk2-Feb-24 7:39
RedDk2-Feb-24 7:39 
GeneralRe: Missing "type specifier " ? Pin
Salvatore Terress2-Feb-24 8:02
Salvatore Terress2-Feb-24 8:02 
GeneralRe: Missing "type specifier " ? Pin
Salvatore Terress2-Feb-24 9:05
Salvatore Terress2-Feb-24 9:05 
GeneralRe: Missing "type specifier " ? Pin
Mircea Neacsu2-Feb-24 10:44
Mircea Neacsu2-Feb-24 10:44 
GeneralRe: Missing "type specifier " ? Pin
k50542-Feb-24 12:15
mvek50542-Feb-24 12:15 
GeneralRe: Missing "type specifier " ? Pin
Salvatore Terress2-Feb-24 15:28
Salvatore Terress2-Feb-24 15:28 
QuestionPreTranslateMessage method is missing Pin
utcode1-Feb-24 16:35
utcode1-Feb-24 16:35 
AnswerRe: PreTranslateMessage method is missing Pin
Victor Nijegorodov1-Feb-24 22:41
Victor Nijegorodov1-Feb-24 22:41 
QuestionPrinting to exact coordinates on paper or lottery tickets Pin
inlandchris11-Feb-24 6:31
inlandchris11-Feb-24 6:31 
AnswerRe: Printing to exact coordinates on paper or lottery tickets Pin
Gerry Schmitz1-Feb-24 7:56
mveGerry Schmitz1-Feb-24 7:56 
GeneralRe: Printing to exact coordinates on paper or lottery tickets Pin
inlandchris11-Feb-24 15:12
inlandchris11-Feb-24 15:12 
Questionhow to bypass loop ? Pin
Salvatore Terress28-Jan-24 6:10
Salvatore Terress28-Jan-24 6:10 
AnswerRe: how to bypass loop ? Pin
k505428-Jan-24 6:30
mvek505428-Jan-24 6:30 
QuestionRe: how to bypass loop ? Pin
CPallini28-Jan-24 21:02
mveCPallini28-Jan-24 21:02 
AnswerRe: how to bypass loop ? Pin
jschell29-Jan-24 4:38
jschell29-Jan-24 4:38 
In C++

Macros
- As noted you can remove the code entirely
- You can also use a macro that resolves to a different value

For code
- Add a flag.
- Add a class that manages flags

Larger apps would use the second.

Your code then tests the flag. There are various ways the flags can be set: command line, config file, database. There are various ways to manage the class itself. Could be static or use a builder pattern.

Example of flag usage

if (myFlagClass.IsSet("TestFlag131")) ....


For systems (not just an app) can use special values in an API. The code of the target service looks for those special values and returns a fixed, or even variable, result. This is somewhat useful in verifying end to end enterprise functionality.
Questionhelp me to replace / clean my hack C++ code PLEASE Pin
Salvatore Terress27-Jan-24 4:41
Salvatore Terress27-Jan-24 4:41 
AnswerRe: help me to replace / clean my hack C++ code PLEASE Pin
Richard MacCutchan27-Jan-24 5:17
mveRichard MacCutchan27-Jan-24 5:17 
QuestionFinding a location for a function that would cause it to get called on a constant basis Pin
Calin Negru26-Jan-24 8:32
Calin Negru26-Jan-24 8:32 
AnswerRe: Finding a location for a function that would cause it to get called on a constant basis Pin
k505426-Jan-24 11:17
mvek505426-Jan-24 11:17 
GeneralRe: Finding a location for a function that would cause it to get called on a constant basis Pin
Calin Negru26-Jan-24 22:03
Calin Negru26-Jan-24 22:03 
QuestionCreating an update function for my game Pin
Calin Negru25-Jan-24 22:13
Calin Negru25-Jan-24 22:13 
AnswerRe: Creating an update function for my game Pin
Richard MacCutchan25-Jan-24 22:21
mveRichard MacCutchan25-Jan-24 22:21 
GeneralRe: Creating an update function for my game Pin
Calin Negru26-Jan-24 0:41
Calin Negru26-Jan-24 0:41 
GeneralRe: Creating an update function for my game Pin
Richard MacCutchan26-Jan-24 0:52
mveRichard MacCutchan26-Jan-24 0:52 
GeneralRe: Creating an update function for my game Pin
CPallini26-Jan-24 1:25
mveCPallini26-Jan-24 1:25 

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.