dialogs that halt program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drsmooth
    New Member
    • Oct 2007
    • 112

    dialogs that halt program

    i know in java there is a method you can call that dras up a dailog requesting user input and, halts all other program functions and holds up the hold program until the ok button is clicked...

    is there a c++ equivalent? if not, could you point me in the direction of making one...

    thanks
    ken
  • Laharl
    Recognized Expert Contributor
    • Sep 2007
    • 849

    #2
    Something like a JOptionPane...I don't know any graphical methods, you'd probably need to use <windows.h> or similar OS-specific APIs for that, but when you use cin, it won't read in the input until the user hits enter. Same goes for getline()/etc, as far as I know.

    Comment

    • drsmooth
      New Member
      • Oct 2007
      • 112

      #3
      yea the problem is i laid it out graphically and dont have a dos window open, what i need to know is sorta what makes the program hold and wait for something that i define


      thanks

      Comment

      • oler1s
        Recognized Expert Contributor
        • Aug 2007
        • 671

        #4
        Basically, you just need any modal dialog box to popup, to prevent interaction with the main program. Easiest way to create one is MsgBox , forcing the user to click OK.

        Comment

        • drsmooth
          New Member
          • Oct 2007
          • 112

          #5
          How do you use MsgBox, thats pretty much exactly what im looking for



          thanks
          Ken

          Comment

          • oler1s
            Recognized Expert Contributor
            • Aug 2007
            • 671

            #6
            Originally posted by drsmooth
            How do you use MsgBox, thats pretty much exactly what im looking for
            It's documented on MSDN, and you could find it with a google search. I won't repeat the documentation, as that would be pointless.

            Actually, based on your question, I have to ask: are you even using a GUI toolkit? You do realize that C++ has no intrinsic concept of dialogs and other aspects of a GUI, right? Everything is implemented as third party libraries, so when you talk about dialogs, etc., I assume you are using such a library. MsgBox is part of the Win32API, so my assumption in that recommendation is you are using that API.

            Comment

            • drsmooth
              New Member
              • Oct 2007
              • 112

              #7
              right now i am using boralnd c++ builder to handle all my graphics...i dont know how its going to work out but im only writing fairly simply represented games right now....

              ill look into that stuff

              thanks alot
              ken

              Comment

              Working...