Thread: Creating menus

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    35

    Creating menus

    Hey,
    I am almost done with the tutorials and some1 has suggested making menus as begineers projects. What exactly is meant by this? Is it like a control menu screen? Any examples or links that will help me make these? sry this is a little vague but I will become more indepth in asking questions when I become more knowledgable with C++. Thx l8er

    -fire

  2. #2
    Registered User
    Join Date
    Aug 2004
    Location
    San Diego, CA
    Posts
    313
    What exactly is meant by this?
    You're asking me to tell you what someone that I don't know meant by 'menus'. I'm afraid that I can't do that, and I highly doubt that anyone on this board can devine that information without ESP.

    However, since you said 'beginner', a guess might be menus from a console screen. EG: Use of while() and perhaps other functions to create given output based on given input.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    35
    yea its all a little vague on the menus part, basically i am looking for some simple projects to make. Any ideas? thx l8er

    -fire

  4. #4
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Print out Pascal's Triangle or prime numbers.

  5. #5
    Registered User
    Join Date
    Apr 2005
    Posts
    35
    yea ive done that on a graphing calc but never through C++, I guess googling wil bring up some hits...Any keywords that will bring up more choices on projects? thx l8er

    -fire

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Searching the boards may also help - it's a common project.

  7. #7
    Registered User
    Join Date
    Apr 2005
    Posts
    35
    k found plenty of good projects but when I was working on my own program for schematic drawing I came across the problem of how to create a menu. As of now NULL is in its place (what the program already put into that spot). This is what menu I am talking about. I want it to have a first screen to say new schem, open schem, library, and some other things. Is this where I put this code for that and how would I go about doing that? Would I put it all in a structure? thx again

    -fire

  8. #8
    Registered User
    Join Date
    Apr 2005
    Posts
    35
    here is the section of code that I think it will go in somewhere but really unsure(not done much with this prog.:
    Code:
      /* The class is registered, let's create the program*/
        hwnd = CreateWindowEx (
               0,                   /* Extended possibilites for variation */
               szClassName,         /* Classname */
               "Firestorm's Schematic Program",       /* Title Text */
               WS_OVERLAPPEDWINDOW, /* default window */
               CW_USEDEFAULT,       /* Windows decides the position */
               CW_USEDEFAULT,       /* where the window ends up on the screen */
               600,                 /* The programs width */
               500,                 /* and height in pixels */
               HWND_DESKTOP,        /* The window is a child-window to desktop */
               NULL,                /* No menu */
               hThisInstance,       /* Program Instance handler */
               NULL                 /* No Window Creation data */
               ;
    I was thinking the NULL near the no menu comment would be where I put the opening screen but still unsure what to place there in the place of null. Is this where is goes or am I completely wrong???
    thx again

    -fire

  9. #9
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    What you're doing is programming with the Win32 SDK. It's best not to say, "I want to make a menu", then look up the code for a menu and fill in the blanks. Do yourself (and those who will be helping you) a favor and start learning the proper way from the beginning.

    http://winprog.org/tutorial/

  10. #10
    Registered User
    Join Date
    Apr 2005
    Posts
    35
    I'm on it , thanks for the link sean. This still deals with C++ just in a diff. format right? thx l8er

    -fire

  11. #11
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Actually, the tutorial uses C, but it's easily compiled as C++. Just add "using namespace std;" under the header files. The following are the standard C header files:

    assert.h
    ctype.h
    errno.h
    float.h
    limits.h
    locale.h
    math.h
    setjmp.h
    signal.h
    stdarg.h
    stddef.h
    stdio.h
    stdlib.h
    string.h
    time.h

    If any of them are used, drop the '.h' extension, and precede the name with a c. So "time.h" will become "ctime". If the tutorial uses any other header files, they will be part of the Win32 SDK, which is not standard. Those header files should just be left as is.

    I wouldn't call this C++ in a different format. It's basically just another library for C++, that requires you to make some big changes to the layout of your program (like the use of WinMain).

  12. #12
    Registered User
    Join Date
    Apr 2005
    Posts
    35
    thanks for the clarification. Will still need to figure out how it works but eventually it will come to me. Can I still use the Dev C++ compiler for win32? thx l8er

    -fire

  13. #13
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Yes. They talk about Visual C++ a lot in that book, and there might be some difference in how you do resource files and stuff, but I never had a problem.

  14. #14
    Registered User
    Join Date
    Apr 2005
    Posts
    35
    K thanks, sorta clear for now but more questions will probably come up when I start my program. thx again

    -fire

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  2. Creating Menus ... Correct steps
    By csonx_p in forum Windows Programming
    Replies: 5
    Last Post: 05-29-2008, 03:20 AM
  3. creating menus and other stuff
    By C+noob in forum Windows Programming
    Replies: 4
    Last Post: 07-13-2005, 07:20 PM
  4. Creating pop up menus
    By Ti22 in forum C++ Programming
    Replies: 22
    Last Post: 01-18-2005, 09:27 PM
  5. Creating Context Menus
    By Okiesmokie in forum Windows Programming
    Replies: 1
    Last Post: 04-25-2002, 04:21 PM