Announcement

Collapse
No announcement yet.

Suppressing Windows Console

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Suppressing Windows Console

    How do I suppress the windows console that pops up upon launching an open inventor application? I am using Open Inventor 9.6 C++ API on a Windows 7 machine.

    Thanks!

  • #2
    Originally posted by bivuser View Post
    How do I suppress the windows console that pops up upon launching an open inventor application? I am using Open Inventor 9.6 C++ API on a Windows 7 machine.
    This is not an Open Inventor issue.
    Windows creates a console window automatically when the Visual Studio project is a "Console Application". Most of the Open Inventor example program projects are console applications because 1\ it's convenient to print messages in the console window and 2\ it's convenient to write simple example programs that build on Windows and Linux. Technically speaking, you are using the Console subsystem rather than the Windows subsystem.

    You can change a console application into a Windows application by tweaking some properties of the project or you can create a new project using the "Win32 Project" template.

    In either case you can no longer use "main()" as your top-level function, you need to implement a "WinMain" function. You can use the same Open Inventor code except "argv[0]" doesn't exist, so you have to pass an application name (string) to SoWin::init(). If you need the actual application name you can call the Windows GetCommandLine() function.
    -Mike

    Comment

    Working...
    X