• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2539
  • Last Modified:

About IDR_MAINFRAME

Hi
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:
-Accelarator
-Toolbar
-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.

Thanks..
0
kellertonil
Asked:
kellertonil
1 Solution
 
vachoohoCommented:
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.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now