Author Topic: Why a Dos window appeares when i run my win32 Gui program?  (Read 10448 times)

Offline facat

  • Multiple posting newcomer
  • *
  • Posts: 19
Why a Dos window appeares when i run my win32 Gui program?
« on: February 10, 2010, 03:33:43 pm »
i write a win32 GUI program in C::B, build and run it. However, a Dos window appears with my GUI window. when i close that Dos window, my GUI window also closes.
i complie my program in VC6 and i do not see a Dos window.
Could anybody tell me why?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Why a Dos window appeares when i run my win32 Gui program?
« Reply #1 on: February 10, 2010, 04:15:52 pm »
Have you setup your C::B project as GUI (Project -> properties -> second tab)?

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Why a Dos window appeares when i run my win32 Gui program?
« Reply #2 on: February 10, 2010, 06:00:49 pm »
Could anybody tell me why?
Unless you setup the project type to "GUI" the console will be shown to allow you to see debug messages you UI app prints into the console. This is useful for debugging, but only for that. A "GUI" based application does not show the console (hence there might be messages piped into the "virtual" console but you won't see them).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline facat

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Why a Dos window appeares when i run my win32 Gui program?
« Reply #3 on: February 11, 2010, 02:50:24 am »
Originally i set the project to console. now how could i change it to GUI?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Why a Dos window appeares when i run my win32 Gui program?
« Reply #4 on: February 11, 2010, 09:38:43 am »
Project -> properties -> second tab -> there you should see "Console", change it to GUI
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline facat

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Why a Dos window appeares when i run my win32 Gui program?
« Reply #5 on: February 11, 2010, 12:47:32 pm »
Project -> properties -> second tab -> there you should see "Console", change it to GUI
i changed it to GUI, but the Dos windows still appears.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Why a Dos window appeares when i run my win32 Gui program?
« Reply #6 on: February 11, 2010, 12:55:08 pm »
i changed it to GUI, but the Dos windows still appears.
in that case either really part of your code (which you might want to post for inspection) or you are not using the "play" symbol for running the project or run a a different (wrong) target or... hard to tell with such less information. It's best if you strip your project to a minimal example and post it here, including project file and code file(s).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline facat

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Why a Dos window appeares when i run my win32 Gui program?
« Reply #7 on: February 11, 2010, 05:56:18 pm »
ok. i solved the problem. i just changed it to GUI for both Debug and Release  .