Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
QuestionHelp me to decipher the error messages Pin
Salvatore Terress20-Jan-24 2:46
Salvatore Terress20-Jan-24 2:46 
AnswerRe: Help me to decipher the error messages Pin
Richard MacCutchan20-Jan-24 3:18
mveRichard MacCutchan20-Jan-24 3:18 
AnswerRe: Help me to decipher the error messages Pin
Dave Kreskowiak20-Jan-24 4:56
mveDave Kreskowiak20-Jan-24 4:56 
AnswerRe: Help me to decipher the error messages Pin
Gerry Schmitz20-Jan-24 6:34
mveGerry Schmitz20-Jan-24 6:34 
AnswerRe: Help me to decipher the error messages Pin
Richard Andrew x6421-Jan-24 11:33
professionalRichard Andrew x6421-Jan-24 11:33 
AnswerRe: Help me to decipher the error messages Pin
CPallini21-Jan-24 20:33
mveCPallini21-Jan-24 20:33 
AnswerRe: Help me to decipher the error messages Pin
jschell22-Jan-24 5:24
jschell22-Jan-24 5:24 
GeneralRe: Help me to decipher the error messages Pin
Richard MacCutchan22-Jan-24 6:22
mveRichard MacCutchan22-Jan-24 6:22 
GeneralRe: Help me to decipher the error messages Pin
Gerry Schmitz26-Jan-24 6:13
mveGerry Schmitz26-Jan-24 6:13 
QuestionLoop thru two dimensional array - edited Pin
Salvatore Terress15-Jan-24 7:41
Salvatore Terress15-Jan-24 7:41 
AnswerRe: Loop thru two dimensional array Pin
jeron115-Jan-24 9:31
jeron115-Jan-24 9:31 
GeneralRe: Loop thru two dimensional array Pin
Salvatore Terress15-Jan-24 9:50
Salvatore Terress15-Jan-24 9:50 

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.