Solved

Console App

Posted on 1998-12-09
1
267 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Arduino EDI - Programming language 3 104
operator overload: incompatible type and too many params 5 83
max float value 3 53
Gaming Software 1 19
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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

830 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