Solved

Console App

Posted on 1998-12-09
1
240 Views
Last Modified: 2010-04-02
Hi... I had a a wonderful dos application written in a very old borland C++. Now I want to just rewrite it in Visual C++. Sounded simple but I cannot find certain equivalent commands. Please help...

1. how do I clear the screen so if the user runs this from dos, the entire screen is cleared. (Borlandc had clrscr())
2. how do I position text at a specific pixel point on the screen (Borlandc had gotoxy(x,y))
3. how do I change the color of my text that I print to the screen
4. and of course, how do I make simple graphs. Drawing a line, placing a point on the graph.

Sorry if this is a bit vague, but so is my knowledge.

0
Comment
Question by:rose3377
1 Comment
 
LVL 6

Accepted Solution

by:
stsanz earned 70 total points
ID: 1179716
1. Use GetConsoleScreenBufferInfo / FillConsoleOutputCharacter / FillConsoleOutputAttribute
See Q99261 item in Microsoft Knowledge base for an example :
"Performing Clear Screen (CLS) in a Console Application"
http://support.microsoft.com/support/kb/articles/q99/2/61.asp

2. Use SetConsoleCursorPosition

3. Use SetConsoleTextAttribute

4. I'm afraid you can't draw graphs on a console screen because it is devoted to text character output.

For more info, see also WriteConsoleXXX functions.

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now