5
votes

I'm working on an MFC application, using external resources.

The resource.h file has been manually edited by other developers and I've seen that there are conflicting IDs.

I've seen the Microsoft TN020: ID Naming and Numbering Conventions.

I was just wondering if the IDs for controls and other resources (strings excluded) must be unique in the whole application or it's just enough if they are unique for each defined dialog.

1
Important is that resources of the same type don't share identifiers - or otherwise they can be put together into one "spot" on the resource section in the binary.Roman R.

1 Answers

5
votes

Two controls in the same dialog must have different IDs (except when using IDC_STATIC, which is -1, in the resource editor). Two controls in different dialogs can have the same ID, good examples for that are buttons with the IDs IDOK and IDCANCEL.