Thread: Adding menu resource to the window... HELP!!!

  1. #1
    DeSeis
    Guest

    Adding menu resource to the window... HELP!!!

    Hello
    Im trying to add a menu resource to my window.
    Im using that :
    CMainWnd::CMainWnd()
    {
    Create(NULL,"Step1",WS_OVERLAPPEDWINDOW,rectDefaul t,NULL,"IDR_MENU1");

    }

    If i change the ,"IDR_MENU1" to NULL it works fine but then no menu. If it stays like that i get ASSERSION ERROR just before its going to run. the program compiles well.
    Is there any other place I need to link the ID of the menu to??
    The ID of the menu is "IDR_MENU1"...
    HELP
    Thanks Alot

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    88
    what compiler do yo use
    ??

  3. #3
    DeSeis
    Guest
    Visual C++ 6.0

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    arnt you supposed to go:

    MAKEINTRESOURCE(IDR_MENU1)?
    "There are three kinds of people in the world...
    Those that can count and those that can't."

  5. #5
    Registered User ExDigit's Avatar
    Join Date
    Jan 2002
    Posts
    31
    Just backing what Okie said:

    CMainWnd::CMainWnd()
    {
    Create(NULL,"Step1",WS_OVERLAPPEDWINDOW,rectDefaul t,NULL,MAKEINTRESOURCE(IDR_MENU1));

    }

  6. #6
    Unregistered
    Guest
    thx people it worked

  7. #7
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Alternatively whenever you name your menu IDR_MENU, you can change the name to "IDR_MENU" , the quotations around the name allow you to use it how you did originally without the macro MAKEINTRESOURCE. Just for your information.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  2. Window scrollbar
    By maxorator in forum Windows Programming
    Replies: 2
    Last Post: 10-07-2005, 12:31 PM
  3. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  4. my wndProc is out of scope
    By Raison in forum Windows Programming
    Replies: 35
    Last Post: 06-25-2004, 07:23 AM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM