5 Replies Latest reply: May 31, 2012 11:08 AM by Steve.Clamage-Oracle RSS

    Show a form

    HuaMin Chen
      Hi,
      Is there an example that will show a form using Solaris studio C++ 12?

      Many Thanks & Best Regards,
      HuaMin

      Edited by: HuaMin Chen on May 30, 2012 4:30 PM
        • 1. Re: Show a form
          Steve.Clamage-Oracle
          Could you explain what you are trying to do? In the context of C++ programming, I have no idea what "show a form" means. That is, "show" and "form" are not C++ concepts.
          • 2. Re: Show a form
            HuaMin Chen
            I mean to show a screen with some text items there. Thanks
            • 3. Re: Show a form
              Steve.Clamage-Oracle
              In standard C++, you can write text to a file or to the standard output streams cout or cerr. For example,
              std::cout << "Hello\n";
              will write the text "hello" and a newline to the standard output. By default on Solaris and Linux, that will be the terminal window where you ran the program.

              If you want to create a special output window or other GUI component, you will need an additional graphical library that provides a programming interface to do what you want. Oracle Solaris Studio does not provide any such libraries. Searching for "GUI library" or "GUI libraries" will turn up quite a few possibilities.

              One popular solution is the open source Qt project.
              http://en.wikipedia.org/wiki/Qt_%28framework%29
              • 4. Re: Show a form
                HuaMin Chen
                Thanks. BTW, why can’t I use “ShowMessage” in my Solaris studio C++?

                Many Thanks & Best Regards,
                HuaMin

                Edited by: HuaMin Chen on May 31, 2012 5:03 PM
                • 5. Re: Show a form
                  Steve.Clamage-Oracle
                  Studio C++ implements standard C++ for Unix and Linux. ShowMessage is not a feature of standard C++, Unix, or Linux.

                  ShowMessage is a feature of other languages, like Delphi and Java. It puts up a message box, which in turn requires a window system and GUI programming interface, which is why I referred you GUI libraries. They might not have a facility spelled exactly ShowMessage, but they will have something equivalent. For example, if you were using Microsoft Visual C++ to program a Windows application, you still wouldn't have ShowMessage. But the Windows application library provides MessageBox, having equivalent functionality.

                  Qt, which I mentioned earlier, has a function showMessage that is part of statusBar.

                  Not all programming languages provide the same facilities, and where facilities overlap, sometimes the details are different. C++ in particular has no built-in facility for GUI programming. For that, you need to get an add-on library.