'IDR_MENU1' : undeclared identifier

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SADIKH
    New Member
    • Mar 2013
    • 1

    #1

    'IDR_MENU1' : undeclared identifier

    'IDR_MENU1' : undeclared identifier
    How to solve it ?.

    Code:
    #include<afxwin.h>
    #include"resource.h"
     class myframe:public CFrameWnd
      {
       public:
           myframe()
            {
             Create(0,"VAZHAYIL",WS_OVERLAPPEDWINDOW,rectDefault,0,MAKEINTRESOURCE(IDR_MENU1));
            }
      };
     class myapp:public CWinApp
      {
       public:
            int InitInstance()
             {
              myframe*p;
              p=new myframe();
              p->ShowWindow(1);
              m_pMainWnd=p;
              return 1;
             }
      };
     myapp a;
    Last edited by Niheel; Mar 16 '13, 08:31 PM. Reason: always show your source in your question, not a seperate post,
  • divideby0
    New Member
    • May 2012
    • 131

    #2
    If it's your source, you've probably forgotten to define IDR_MENU1 or maybe have omitted the header/resource that contains its definition. I don't use MFC or resource files, so I can't offer any ideas on those; with API only, I tend to define things in header files.

    Code:
    // just an example
    #define IDR_MENU1 1001
    If it's someone else's source, you'll have to mill over that to find out what value it should be. Your compiler may allow you to search the project files and/or other folders directly. If it does, try searching for IDR_MENU1
    Last edited by weaknessforcats; Mar 17 '13, 04:25 AM. Reason: fixed bug in macro

    Comment

    Working...