Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 5th, 2004, 6:07 AM   #1
BruceLeroy
Newbie
 
Join Date: Nov 2004
Posts: 18
Rep Power: 0 BruceLeroy is on a distinguished road
Is there any way I can have a windowed app that also prints statements to the console? I'm having a hard time debugging my app, I'd just like to see some values printed to the screen in order to get some idea where its going wrong.
BruceLeroy is offline   Reply With Quote
Old Nov 5th, 2004, 9:08 AM   #2
phrosys
Newbie
 
Join Date: Nov 2004
Posts: 24
Rep Power: 0 phrosys is on a distinguished road
The easiest way is to write all your debug messages to text file and 'tail -f' it
phrosys is offline   Reply With Quote
Old Nov 5th, 2004, 9:04 PM   #3
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
Hrml, you know... with all the windows coding I have done I have never actually attempted to do anything like this, i would have just figured that you would cout or printf and it would appear on a relative console, though you might initially need to execute the program from the console or that text would get dumped into bit-oblivion... kind of like would be done on a linux system

I know that with C# you can just write to System.Console, even when in graphical mode, so there is likely a way to do it. Other options include writing to file, which is more commonly done since files can be stored, printed, and so forth. Actually if you goto my website the CMRLib project on my Projects has a VERY NICE logging class which I have opensourced and you can use for this purpose.

Since the logging class was created so that it could be easily exported from a DLL file, there is a bit of a trick to actually initiating the interface.... psuedo-com like if you will, just look at the test project which initializes the interface in 2 lines of code... you will understand, it is very easy to work with, and comes in its own .lib file for easy importing to your project.

My website: http://www.cliffordroche.com
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Nov 7th, 2004, 7:02 AM   #4
BruceLeroy
Newbie
 
Join Date: Nov 2004
Posts: 18
Rep Power: 0 BruceLeroy is on a distinguished road
thanks guys, I will try your suggestions.

btw, i don't think cout or printf work for win32 apps or it didn't since last time I tried. I launched the app from the command line but no joy.
BruceLeroy is offline   Reply With Quote
Old Nov 9th, 2004, 1:52 AM   #5
monkey8
Newbie
 
Join Date: Nov 2004
Posts: 12
Rep Power: 0 monkey8 is on a distinguished road
Quote:
Originally posted by BruceLeroy@Nov 7 2004, 12:02 PM
thanks guys, I will try your suggestions.

btw, i don't think cout or printf work for win32 apps or it didn't since last time I tried. I launched the app from the command line but no joy.
When I used SDL on windows, and used std::cout, it would output to ./stdout.txt
monkey8 is offline   Reply With Quote
Old Nov 9th, 2004, 5:36 PM   #6
BruceLeroy
Newbie
 
Join Date: Nov 2004
Posts: 18
Rep Power: 0 BruceLeroy is on a distinguished road
outputting to a file works great. thanks guys.
BruceLeroy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC