#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    18
    Rep Power
    0

    How to do ComboBox?


    how to made combo box in visual c++ 6.0 console program? if i had done in keypressed('A') ........to list the choices..........

    how to transfer it to the combobox? got any code available?
  2. #2
  3. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    28
    a combo in a console app, does it display?

    AFAIK it is not possible, you need a WIN32 or MFC app ect (has winmain() not main() ).

    C or C++ or MFC?
    The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

    Frank Zappa
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    18
    Rep Power
    0
    got winmain.........using visual c++..

    sir, last time u told me MFC not suitable for game programming... what is the reason for not provided (event loop)? does it affect anything? why u mentioned is not begiiner stuff? can sir explain more details?
  6. #4
  7. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    28
    >>console

    16Bit DOS based window. Not a 2D style game.

    Combo box 32bit Windows common control. Use CreateWindow() or add a combobox to a dialog in the resource editor.

    >>told me MFC not suitable for game programming

    Look here for code on game programming

    http://www.gametutorials.com/

    games use PeekMessage() as it will return even if it does not have a message. This allows other code to execute outside the message processing loop. It does take 100% CPU time.

    Normal apps use GetMessage which will wait until there is a message for th app. This does not allow code outside the message loop to be run but uses much less CPU time.

    MFC has a wrapper around the massage loop so you can not change the way it functions. Not to metion a statically linked 'hello world' app is nearly 400Kb in MFC compared to 30K in WIN32 C++. Size == slow.
    The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

    Frank Zappa
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    18
    Rep Power
    0
    sir, sorry to let you know..i m 'new bee' in game programming. can you plz simplified ur justificaiton..?

    i not really get sir means?

    1. even is for wat? take 100% cpu? anything wrong?

    2. since normal..eg MFC does not allow code outside the message loop to be run but uses much less CPU time.

    if use less cpu time? anything wrong?
    why cannot code outside the message loop?

    sorry to cause incovenient..........if i am writing a report.....how am i going to justified the reason (in simplified) words .....due facing mfc probelms , then, change using window applicaiton to code....................?????????
  10. #6
  11. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    28
    Not sure I 100% understand the questions.

    In windows programs the application asks the OS if anything has happened. If something has, the OS gives the application a message (msg). This tells teh application exactly what thas happened (user pushed a key, mouse moved or a network did something)
    This is called the msg loop or msg pump.

    The application can use GetMessage() or PeekMessage() to ask for these msg's.

    GetMessage() will wait until the OS has a msg for teh application. This takes little CPU time so other applications can run at the same time. The application can do nothing until the OS sends it a msg.

    PeekMessage() asks if there is a msg, if not PeekMessage() returns empty. The application can then do other things. Games want to redraw the screen as things move in time (bullets, enemies ect move, computer has move). When the application is finished it again asks the OS for a msg with PeekMessage()
    This will take up 100% of CPU so other applications can not do anything.

    In WIN32 you have access to the msg loop so can add the code for a game to do if there is not a msg.

    MFC is exter code written so the WIN32 API is easier to use. This ease of use makes it slower.
    In MFC you do not have access to the msg loop. So can not modify what the game does while there are no msg's for the game.

    Have a look at the code in the first tute here

    http://www.gametutorials.com/Tutoria.../Win32_Pg1.htm
    The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

    Frank Zappa

IMN logo majestic logo threadwatch logo seochat tools logo