473,414 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

printout statements

Hello all,
I have a C++ program written as a CWinApp which compiles but somewhere
has an error. I use the visual studio .NET compiler by the way. I am
use to programs written in unix environment. Because the program has an
error I want to use print out statements using cout to check values of
my variables. But the problem is that I do not have a console where it
prints out the value. How do I check now the value ??? Thank you in
advance for your help.
Robert

Jul 23 '05 #1
5 1432
wo*********@yahoo.com wrote:
Hello all,
I have a C++ program written as a CWinApp which compiles but somewhere
has an error. I use the visual studio .NET compiler by the way. I am
use to programs written in unix environment. Because the program has
an error I want to use print out statements using cout to check
values of my variables. But the problem is that I do not have a
console where it prints out the value. How do I check now the value
??? Thank you in advance for your help.


You will need to ask this question in a forum dedicated to your Windows
compiler. Here only the C++ language itself is discussed, which does not
cover those special issues of Windows programs. If you go to the Microsoft
web site and look for the newsgroups, you will find many there.

--
Attila aka WW
Jul 23 '05 #2
wo*********@yahoo.com wrote:
I have a C++ program written as a CWinApp which compiles but somewhere
has an error. I use the visual studio .NET compiler by the way. I am
use to programs written in unix environment. Because the program has an
error I want to use print out statements using cout to check values of
my variables. But the problem is that I do not have a console where it
prints out the value. How do I check now the value ???


Use 'OutputDebugString' together with 'sprintf', the string will be output
to the debugger window (RTFM on it). And questions on debugging Windows
applications are better asked in a Windows programming newsgroup (like
comp.os.ms-windows.programmer.win32). Here such questions are off-topic.

V
Jul 23 '05 #3
wo*********@yahoo.com wrote:
Hello all,
I have a C++ program written as a CWinApp which compiles but somewhere
has an error. I use the visual studio .NET compiler by the way. I am
use to programs written in unix environment. Because the program has an
error I want to use print out statements using cout to check values of
my variables. But the problem is that I do not have a console where it
prints out the value.
Why don't you have one?
How do I check now the value ???
Redirect the output to a file. Under linux, you can do:

../myprogram > file

to write the result into a file. Or you can instead of to cout write it into
an fstream within your program.
Thank you in advance for your help.

Jul 23 '05 #4
"wo*********@yahoo.com" wrote:

Hello all,
I have a C++ program written as a CWinApp which compiles but somewhere
has an error. I use the visual studio .NET compiler by the way. I am
use to programs written in unix environment. Because the program has an
error I want to use print out statements using cout to check values of
my variables. But the problem is that I do not have a console where it
prints out the value. How do I check now the value ??? Thank you in
advance for your help.
Robert


Technically you are off-topic because your question is related
to how a specific compiler under a specific operating system works.
So next time ask in a Windows programming group.

However:
* Visual Studio comes with a good debugger. You should not have
problems to use that. The debugger can show any variable.
Just position the caret on the variable, right click and select
'Quick View' (That's how it worked under VC++ 6.0, but I guess
.NET is not much different)

* When you have your debugger running, check out the TRACE macro
This comes in handy, if you regularily need to output great amounts
of debug data.

* If all else fails, you can always use MessageBoxes to pop up
a quick and dirty output dialog.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 23 '05 #5
wo*********@yahoo.com wrote:
Hello all,
I have a C++ program written as a CWinApp which compiles but somewhere
has an error. I use the visual studio .NET compiler by the way. I am
use to programs written in unix environment. Because the program has an
error I want to use print out statements using cout to check values of
my variables. But the problem is that I do not have a console where it
prints out the value. How do I check now the value ??? Thank you in
advance for your help.
Robert


Try outputting your messages to a text file.
This will also show the messages in the order they
were executed and you don't have to mess with any
extra windowing stuff.

And sending text to a text file is _standard_
C++. :-)

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Klefevre | last post by:
Hi, I was wondering why the code below does not work in ASP. Why does the printout method not work? Tx, Kurt Dim m_strPrinterDeviceName Dim m_objExcelApplication, m_objExcelWorkBook,...
0
by: ivan | last post by:
Access97 While in ADD mode- I have a command button that has the following: DoCmd.Printout acSelection This command gives me an error message (after it prints), that there is not enough...
1
by: P | last post by:
Hi, Access 2002. I am trying to use the PrintOut function to print the current record of the current open form in landscape format to the default Windows printer. Any suggestion on how to set...
0
by: Owen Jenkins | last post by:
I use the DoCmd.Printout method to print reports using the client's default options This has worked fine for years with Access 97 and 2000/2, Win95-XP. However two clients have recently complained...
3
by: RC | last post by:
I am using docmd.printout to send Reports (formatted as labels) to a barcode label printer. I need to collate the labels so that I print lable 1 twice, then label 2 twice, then label 3 twice, etc....
2
by: Smartin | last post by:
Question about DoCmd.PrintOut in A97. I have a form on which all the controls are unbound. There is a large textbox that the user can type stuff in and a couple labels. I am trying to code a...
1
by: Elhanan | last post by:
hi.. sorry for the cross posting, i'm simply not sure where this goes (i'm still genrating this from an asp page). i'm trying to printout normal text from IE using Generic Text Driver like...
2
by: MLH | last post by:
Dim HowManyCopies As Integer HowManyCopies = 4 DoCmd.OpenReport "rptSeparatorSheet", acViewPreview DoCmd.PrintOut acPrintAll, acHigh, HowManyCopies, False DoCmd.Close acReport,...
1
by: =?Utf-8?B?S2ltIFM=?= | last post by:
I have a word document I only want to printout ( not save as file ) and I use Word printout method in backgrund but my XP operativ i so slow that a "dummy" dociment also get stored. which...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.