Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MFC - Resource IDs uniqueness

Tags:

visual-c++

mfc

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.

like image 734
Ste Avatar asked Jul 02 '13 14:07

Ste


1 Answers

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.

like image 101
Werner Henze Avatar answered Nov 05 '22 14:11

Werner Henze