Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Zoom image on mouse position Pin
Gopi Nath14-Mar-21 20:34
Gopi Nath14-Mar-21 20:34 
QuestionSelect TRACE functions based on both a variable and a #define? Pin
arnold_w11-Mar-21 5:31
arnold_w11-Mar-21 5:31 
AnswerRe: Select TRACE functions based on both a variable and a #define? Pin
Richard MacCutchan11-Mar-21 6:11
mveRichard MacCutchan11-Mar-21 6:11 
GeneralRe: Select TRACE functions based on both a variable and a #define? Pin
arnold_w11-Mar-21 7:07
arnold_w11-Mar-21 7:07 
GeneralRe: Select TRACE functions based on both a variable and a #define? Pin
Richard MacCutchan11-Mar-21 23:11
mveRichard MacCutchan11-Mar-21 23:11 
GeneralRe: Select TRACE functions based on both a variable and a #define? Pin
arnold_w12-Mar-21 0:54
arnold_w12-Mar-21 0:54 
GeneralRe: Select TRACE functions based on both a variable and a #define? Pin
Richard MacCutchan12-Mar-21 1:22
mveRichard MacCutchan12-Mar-21 1:22 
GeneralRe: Select TRACE functions based on both a variable and a #define? Pin
arnold_w12-Mar-21 1:51
arnold_w12-Mar-21 1:51 
On the following webpage C Preprocessor tricks, tips, and idioms · pfultz2/Cloak Wiki · GitHub[^] it is shown how an IIF (immediate if) statement for macros can be implemented. But as soon as I pass an expression, as oppose to either 0 or 1, to it, I can't get it to compile either:
C++
#define USER_EVENTS_LOGGING          0x00000001
#define COMMUNICATION_BUS_LOGGING    0x00000002

#if defined(ENABLE_USER_EVENTS_LOGGING) && defined(ENABLE_COMMUNICATION_BUS_LOGGING)
#define HARDCODE_ENABLED_MY_GRP_BIT_FLAGS      (USER_EVENTS_LOGGING | COMMUNICATION_BUS_LOGGING)
#elif !defined(ENABLE_USER_EVENTS_LOGGING) && defined(ENABLE_COMMUNICATION_BUS_LOGGING)
#define HARDCODE_ENABLED_MY_GRP_BIT_FLAGS      (COMMUNICATION_BUS_LOGGING)
#elif defined(ENABLE_USER_EVENTS_LOGGING) && !defined(ENABLE_COMMUNICATION_BUS_LOGGING)
#define HARDCODE_ENABLED_MY_GRP_BIT_FLAGS      (USER_EVENTS_LOGGING)
#else
#define HARDCODE_ENABLED_MY_GRP_BIT_FLAGS      (0)
#endif

IIF(1)(true, false)                                                               // Compiles fine
IIF((0 < (HARDCODE_ENABLED_MY_GRP_BIT_FLAGS & USER_EVENTS_LOGGING)))(true, false) // Doesn't compile!

GeneralRe: Select TRACE functions based on both a variable and a #define? Pin
Richard MacCutchan12-Mar-21 2:43
mveRichard MacCutchan12-Mar-21 2:43 
QuestionMFC: CMFCPropertysheet CMFCPropertypage Pin
Member 1325158810-Mar-21 19:35
Member 1325158810-Mar-21 19:35 
AnswerRe: MFC: CMFCPropertysheet CMFCPropertypage Pin
Victor Nijegorodov10-Mar-21 20:21
Victor Nijegorodov10-Mar-21 20:21 
QuestionCMFCToolTipCtrl doen't enter OnPaint when I use it in my self-draw CTreeCtrl Pin
Member 1488267128-Feb-21 15:52
Member 1488267128-Feb-21 15:52 
AnswerRe: CMFCToolTipCtrl doen't enter OnPaint when I use it in my self-draw CTreeCtrl Pin
Randor 4-Mar-21 10:33
professional Randor 4-Mar-21 10:33 
AnswerRe: CMFCToolTipCtrl doen't enter OnPaint when I use it in my self-draw CTreeCtrl Pin
Victor Nijegorodov4-Mar-21 20:39
Victor Nijegorodov4-Mar-21 20:39 
QuestionMFC Dialog Based App Scaling Problem Pin
acerunner31626-Feb-21 6:28
acerunner31626-Feb-21 6:28 
AnswerRe: MFC Dialog Based App Scaling Problem Pin
RedDk26-Feb-21 7:22
RedDk26-Feb-21 7:22 
GeneralRe: MFC Dialog Based App Scaling Problem Pin
acerunner31626-Feb-21 9:03
acerunner31626-Feb-21 9:03 
GeneralRe: MFC Dialog Based App Scaling Problem Pin
Dave Kreskowiak26-Feb-21 9:53
mveDave Kreskowiak26-Feb-21 9:53 
GeneralRe: MFC Dialog Based App Scaling Problem Pin
acerunner3161-Mar-21 14:00
acerunner3161-Mar-21 14:00 
GeneralRe: MFC Dialog Based App Scaling Problem Pin
Dave Kreskowiak1-Mar-21 14:43
mveDave Kreskowiak1-Mar-21 14:43 
GeneralRe: MFC Dialog Based App Scaling Problem Pin
RedDk26-Feb-21 10:10
RedDk26-Feb-21 10:10 
GeneralRe: MFC Dialog Based App Scaling Problem Pin
acerunner3161-Mar-21 14:13
acerunner3161-Mar-21 14:13 
GeneralRe: MFC Dialog Based App Scaling Problem Pin
RedDk1-Mar-21 15:25
RedDk1-Mar-21 15:25 
QuestionRe: MFC Dialog Based App Scaling Problem Pin
Richard MacCutchan27-Feb-21 0:52
mveRichard MacCutchan27-Feb-21 0:52 
AnswerRe: MFC Dialog Based App Scaling Problem Pin
acerunner3161-Mar-21 14:11
acerunner3161-Mar-21 14:11 

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.