I am new in MFC programming. I confused about IDR_MAINFRAME in resorce file. I want to ask you a question about this.
When i create an SDI or MDI project, wizard generate codes for me. But in Resource file:
-Menus's names are same and IDR_MAINFRAME.

Why is this so? Isn't wrong to give same name different resouces?
If i use IDR_MAINFRAME in my code how can compiler undertand it is toolbar or menu or accelarator or something else? I am confused about IDR_MAINFRAME concept in MFC programming. I hope i can expalin the problem.

Who is Participating?
vachoohoConnect With a Mentor Commented:
It works fine as soon as you have unique ID per resource type.
Menu and Icon with the same ID do not conflict with each other.
This way all related resources are linked together (logically of course)
IDR_MAINFRAME menu and icon both belongs to the main frame window.
Surely this is all matter of convension. You may choose to break it and use different convension or style.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.