Author Topic: Shared resource symbols changed globally  (Read 1838 times)


  • Guest
Shared resource symbols changed globally
« on: December 10, 2009, 07:22:27 pm »
When two or more controls (on the same dialog or on different dialogs) use the same resource ID symbol (for example IDC_PASSWORD defined as 101 in resource.h) and then you change the name property of one of those controls from the dialog editor Properties palette (for example, from IDC_PASSWORD to IDC_NAME), the shared IDC_PASSWORD symbol retains value of 101 but it's name gets changed to IDC_NAME, which affects all other controls on dialog boxes in project's resource file that refer to that symbol. So all of a sudden all controls that used to be named IDC_PASSWORD are named IDC_NAME across the entire project just from changing the name of one control.

The current behavior makes it extremely challenging to rename dialog box controls except to open the .rc file and modify it by hand. It would be much easier if to rename a control I could just type in a new symbol name, which will generate a new symbol with a new value unless a symbol with that exact name already exists, in which case the existing symbol would be assigned. This is also the behavior that Visual Studio has.

P.S. It appears that renaming a dialog box, an icon, or any other resource that uses symbols defined in resource.h exhibits the same behavior. A fix would be greatly appreciated.

This problem has been reported several times in the past: