I have been learning Win32 GUI programming today and I have come across a question I have not found the answer to.
Why do resource.hpp files define resources with such high ID numbers? For instance, the tutorial I am following has 2 resources in resources.rc - A MENU and an ICON. The MENU has 3 MENUITEMs total.
Here is the tutorial's resource.hpp (which defines the int IDs for these resources):
#define IDR_MYMENU 101 // MENU ID
#define IDI_MYICON 102 // ICON ID
#define ID_FILE_EXIT 40001 // MENUITEM 1 ID
#define ID_STUFF_GO 40002 // MENUITEM 2 ID
#define ID_STUFF_GOSOMEWHEREELSE 40003 // MENUITEM 3 ID
Why not instead use understandable IDs such as:
#define IDR_MYMENU 1 // MENU ID
#define IDI_MYICON 2 // ICON ID
#define ID_FILE_EXIT 3 // MENUITEM 1 ID
#define ID_STUFF_GO 4 // MENUITEM 2 ID
#define ID_STUFF_GOSOMEWHEREELSE 5 // MENUITEM 3 ID
As more resources are added, you simply increase the count. I can understand a buffer to separate MENUITEMS from ICONS and so on; but why this much of a buffer with so few resources?
I also understand this resource.hpp file (tutorial's) was generated by a program, but the question still stands for me.
Could someone please enlighten me? Thank you.