User forums > Help
Small bug in Win GUI Project wizard
cpprooky:
When I create à Win32 GUI project, in the Project properties, the build target type is set to "Console application" instead of "GUI application" ! This is not a very important bug, I agree, but that's boring to have to change that setting for every new project !
could you change that easily ?
MortenMacFly:
--- Quote from: cpprooky on August 02, 2006, 03:25:40 pm ---could you change that easily ?
--- End quote ---
No, because it's not a bug but a feature. If you look into it, only the debug target is set to be a console project. This is on purpose as many debug information you issue within a GUI application are actually send to the console. This is a usual concept (have a look at several debug macros) and if you declare the debug target as GUI application you would not see the messages printed to the console.
So we won't chnage this because it's by design. Anyway, if you don't like this feature you can disable it in the wizard script easily. Just right-click on the script, edit it and change the debug target creation to how it's done in the release target:
Change the line:
--- Code: --- target.SetTargetType(ttConsoleOnly); // ttConsoleOnly: console for debugging
--- End code ---
into:
--- Code: --- target.SetTargetType(ttExecutable); // ttExecutable: no console
--- End code ---
With regards, Morten.
tiwag:
you have to say additionally, that debug info sent to the console stdout is working in linux,
but not in windows, where this console is quite useless.
(there are existing some tricks, how you can redirect stdout to this console window,
but it is not standard and doesn't work with the supplied samples)
MortenMacFly:
--- Quote from: tiwag on August 02, 2006, 09:58:23 pm ---(there are existing some tricks, how you can redirect stdout to this console window,
but it is not standard and doesn't work with the supplied samples)
--- End quote ---
That's right, I for myself use a concept similar to http://www.codeproject.com/debug/debugcon.asp for debugging to the console within a Win32 application but yes, within the Win32GUI example this is not done, indeed.
(Edit: What I mean hereby is that there are often other methods used within Win32 indeed.)
takeshimiya:
A solution to redirect output to the console in Windows is:
* For example in SDL, which by default redirects to a file, just add this below main():
--- Code: (cpp) ---freopen("CON", "wt", stdout); // redirects stdout
freopen("CON", "wt", stderr); // redirects stderr
--- End code ---
* In Win32 GUI, if you want to open and close the console dinamycally:
http://lua-users.org/lists/lua-l/1999-08/msg00001.html
Navigation
[0] Message Index
[#] Next page
Go to full version