• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

Console App

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
rose3377
Asked:
rose3377
1 Solution
 
stsanzCommented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now