Posted on 2007-08-09
Last Modified: 2013-11-20
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.

Question by:kellertonil
    1 Comment
    LVL 5

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now