Results 1 to 16 of 16

Thread: Menus (API)

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    How do I make'm?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You need to make a menu in the resource editor...here's a sample project...
    I'll try and find some decent info in a moment.
    Attached Files Attached Files
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    So here's what I see.

    You make the menu with a resource file. You Add it to the CPP File with quotes. You just put it in the switch to see what's pushed. Is that correct?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Almost. The .rc file is compiled separately from the .cpp file, to make a .res file. The file resource.h contains the definitions of the numerical items in the resource file, and is included into the .cpp file.

    The linker combines the .res file along with the rest when it makes the final .exe.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Code:
    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/Random Practices.exe : fatal error LNK1120: 1 unresolved externals
    What do these two errors mean? These are what I get when I try to run the program.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You need to make sure that your project type is "Win32 Application" not "Win32 Console Application" and all the files have been added to the project.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    for some reason I can't make a resource file anymore....I can design it but it won't show up in the list.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    the menu doesn't show up
    Last edited by SteveCRM; Mar 4th, 2001 at 07:49 PM.

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Never mind I got it

  10. #10
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    How did you do it????
    I don't know if you have seen my post Menus again...
    I was also trying to add a menu to my C++ program, but it just wouldn't show up!! How did you do it???
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  11. #11
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I used exactly the same method as you did in yours...and it works in VC++

    This is really weird...I have no idea
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  12. #12
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Hi parksie! I don't know if you have seen my reply, in Menus again.....take a look!!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  13. #13

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    did you try this? This pissed me off for a few minutes...iit won't show up without this...
    Code:
    SetMenu(ghWnd_Main, LoadMenu(hInstance, MAKEINTRESOURCE(IDR_MENU1)));

  14. #14
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Hi Steve!
    I found the problem....I forgot to include the .rc file into the compiler....doooh!!!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  15. #15

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    yeah I read your thread right after I replied...congratulations

  16. #16
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Thank you!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width