I have resource file which specifies a dialog. In this dialog I display the app name, version and if it is the 32bit or 64bit version of the program.
#ifdef WIN64
LTEXT "My App, Version 1.2.3.0 (64 bit)", IDC_APPLICATION_TITLE_TEXT, 42, 14, 251, 16, SS_NOPREFIX
#else
LTEXT "My App, Version 1.2.3.0 (32 bit)", IDC_APPLICATION_TITLE_TEXT, 42, 14, 251, 16, SS_NOPREFIX
#endif
This all works great, until I use Visual Studio to edit any of my dialogs, this triggers the resource file to be saved by VS and it strips out my #ifdef leaving only one of the entries (either 32bit or 64bit)
LTEXT "My App, Version 1.2.3.0 (64 bit)", IDC_APPLICATION_TITLE_TEXT, 42, 14, 251, 16, SS_NOPREFIX
My question is, is there a way to prevent VS from striping out the #ifdefs
when I edit dialogs in directly in VS, or is there a way to construct the text used in the resource in a way that can be used in the resource.