Page 1 of 2

Seeing output in MSW

Posted: Fri Apr 12, 2013 4:25 pm
by iwbnwif
Sorry for a very basic question, but I cannot find how to see my program's output under MSW.

In Linux either xterm opens when I run the program or a degguging window opens if I am debugging. In both cases std::cout goes to a window.

But I don't get either of these in MSW and despite a googling a wide range of keywords, surprisingly nothing turns up with the answer.

Thanks for helping!

Re: Seeing output in MSW

Posted: Fri Apr 12, 2013 5:43 pm
by eranif
Are you writing a GUI application or console?

Eran

Re: Seeing output in MSW

Posted: Fri Apr 12, 2013 6:17 pm
by iwbnwif
Sorry I should have made that clear, its a GUI

Re: Seeing output in MSW

Posted: Fri Apr 12, 2013 6:37 pm
by eranif
IIRC, under Windows, GUI applications are created without a console attached

If you are using wxWidgets, use wxLogMessage and set up a log window for this

http://docs.wxwidgets.org/2.9.4/group__ ... gging.html
Eran

Re: Seeing output in MSW

Posted: Fri Apr 12, 2013 6:50 pm
by iwbnwif
So there is no CL debugging output window under MSW the same way as there is in Linux?

Re: Seeing output in MSW

Posted: Sat Apr 13, 2013 8:42 am
by eranif
No, its up to your code to provide it

Eran

Re: Seeing output in MSW

Posted: Sat Apr 13, 2013 1:05 pm
by iwbnwif
Thank you for taking the time to explain this.

I would like to add this as a feature request, actually it would be really nice to have a window in the IDE for both Windows and Linux where std::cout can be seen rather than a pop-up terminal (Linux) and /or having to implement a wxLogWindow (Linux and Windows).

Do you mind if I add this as a feature request?

Re: Seeing output in MSW

Posted: Sat Apr 13, 2013 3:47 pm
by eranif
Like I said: its up to your application to create such window , codelite can't do that for you.

Eran

Re: Seeing output in MSW

Posted: Sat Apr 13, 2013 4:49 pm
by petah
On Linux all you need to see logs in CL's debugger pane is:

Code: Select all

new wxLogChain(new wxLogStderr(stdout))
if it doesn't work as is on Windows see MSDN docs around ::OutputDebugString(). If your app isn't wx-based, copy the part of wxLog code you need to replicate it.

cheers,

-- p

Re: Seeing output in MSW

Posted: Sun Apr 14, 2013 7:29 pm
by iwbnwif
Thank you for your replies.

The problem with the following is that in MSW stdout doesn't appear to go anywhere (under Windows 8 at least).

Code: Select all

new wxLogChain(new wxLogStderr(stdout))
see MSDN docs around ::OutputDebugString()
Thank you for this tip. I tried this but also the output seems to go nowhere, even if I set debugevents as it suggests in the gdb manual.

So I think the only way is (as Eran suggested) to create a wxLogWindow.

Code: Select all

wxLogWindow *w= new wxLogWindow(this, wxT("Logger"));
w->Show();
Just a thought, but personally I would like all stdout to go to the "Output" tab of the "Output View" pane :)