Why is Visual Studio resource editor replacing some of my constants with values on save

144 views Asked by At

I'm working on a project which has seen a lot of different Visual Studio versions over the years.

For some installations, currently with VS2022, V 17.1.3 (but also before with VS2019) whenever i edit resources and save them, some of the constants of dialog resources are replaced with numbers in the .rc file:

F.e. ES_AUTOHSCROLL is replaced by 0x80

CONTROL         "",IDC_TXT,"RichEdit20W",ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP,96,115,38,12
CONTROL         "",IDC_TXT,"RichEdit20W",WS_BORDER | WS_TABSTOP | 0x80,96,115,38,12

and ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN is replaced by 0x10c4

CONTROL         "",IDC_COMMENT,"RichEdit20W",ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_BORDER | WS_TABSTOP,95,204,219,30
CONTROL         "",IDC_COMMENT,"RichEdit20W",WS_BORDER | WS_TABSTOP | 0x10c4,95,204,219,30

A seemingly arbitrary define from Resource.h is replaced in DLGINIT from

IDC_SOME, 0x403, 9, 0

to

1838, 0x403, 9, 0

even though it is defined in Resource.h as

#define IDC_SOME 1838

and no others are replaced.

Also a line is inserted between all bitmap and cursor resources so that

IDR_MAINFRAME           BITMAP                  "res\\Toolbar.bmp"
IDB_TREEITEM            BITMAP                  "res\\treeitem.bmp"

and

IDC_TRACKBALL           CURSOR                  "res\\track.cur"
IDC_ZOOMWINDOW          CURSOR                  "res\\zoom1.cur"

become

IDR_MAINFRAME           BITMAP                  "res\\Toolbar.bmp"

IDB_TREEITEM            BITMAP                  "res\\treeitem.bmp"

and

IDC_TRACKBALL           CURSOR                  "res\\track.cur"

IDC_ZOOMWINDOW          CURSOR                  "res\\zoom1.cur"

Is this a bug or is there a setting or property which can be used to stop this?

0

There are 0 answers