Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Making the DOS window disapear ....

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2000
    Location
    Brasil
    Posts
    19

    Making the DOS window disapear ....

    Hi,

    I am using VC++ 5.0 in Win98 and everytime I execute my OpenGL program with GLUT 2 windows is appearing on the screen: a DOS Application Window and My Aplication window.
    How can i make the first one disapear.
    I know that there are some compiler directives in VC to do it.
    Wait for response.
    hmcranio is platoberg

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2000
    Posts
    3

    Re: Making the DOS window disapear ....

    When you create your project in Visual C++ (under File->New), choose "Win32 Application" instead of "Win32 Console Application". In your code, write a WinMain() function instead of the standard main() function.

    int WINAPI WinMain(HINSTANCE, HINSTANCE, LPTSTR commandLine, int);


    I think those are the only changes, but play around with it.

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2000
    Location
    Brasil
    Posts
    19

    Re: Making the DOS window disapear ....

    Thanks Bman but there is a small problem, if I use winmain instead of main the source-code will loose portability and that's the biggest reason to me to use GLUT.
    I found in a GLUT FAQ that I can use this compiler flags below:
    /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup
    Does anybody knows how can I use that ?
    hmcranio is platoberg

  4. #4
    Intern Newbie
    Join Date
    Oct 2000
    Location
    Yverdon-les-Bains/Switzerland
    Posts
    30

    Re: Making the DOS window disapear ....

    I'm don't speak very well anglish, but if I understand you question you can make that (with Visual C++ 6.0):

    1) Projet->Setting...->Link

    2) In Categories choose : Output

    3) write in Entry-point symbol: " mainCRTStartup"

    After what I think it's correct!

    Jérôme

  5. #5
    Intern Contributor
    Join Date
    Jul 2000
    Location
    Braga, Portugal
    Posts
    97

    Re: Making the DOS window disapear ....

    Great! It works. I've not posted to this thread yet, but when I saw that there could be a solution i tried it and it worked.

    Here's the complete setup:

    Select "Project" -> "Settings"
    Select the "Link" tab
    In the bottom of the dialog box there is a text area with the "Project Options".
    Look for the word "subsystem", after it there should be "console", replace it with "windows".
    Add the following string to the options: "/entry:mainCRTStartup".

    Thats it, and it works!

    Antonio www.fatech.com/tech
    Antonio Ramires Fernandes www.lighthouse3d.com

  6. #6
    Junior Member Newbie
    Join Date
    Oct 2000
    Location
    Brasil
    Posts
    19

    Re: Making the DOS window disapear ....

    Thanx Boubou and Antonio.

    Now it's working fine !!
    hmcranio is platoberg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •