Jump to content
xisto Community
Sign in to follow this  
xyanide

C++ Windows Console Application newbie here

Recommended Posts

Hi!I am not quite sure of what you mean when you refer to machine problem on console application. Some of the problems that you might experience when developing a console application are the inability to use the windowing capabilities provided by Windows so you will have to create your own code for building a user interface framework.For example, suppose you want to display a text-based interface and want to center a string of text on the screen, you would not have the ability to simply create a centered window on the screen and drag-and-drop a label control, with the centered alignment property, onto it. You have to calculate the length of the string, divide the length into half, find the width of the screen in characters (usually about 80 characters, but it may differ), divide the screen width into half, subtract half the length of the string from half the width of the screen, and then display the string.There are libraries such as ncurses that enable you to do a lot more on the Linux platform, such as displaying colored text. You can do the same on the Windows platform with the ANSI.SYS driver (i.e. by using ANSI terminal emulation; there are different kinds of terminals that you can get support for if you use a software such as HyperTerminal but it is for obtaining input and sending output to a serial or parallel port or to a TCP/IP socket - you still can use it but you will have to deal with the added complexity of writing to a socket file descriptor or a port driver rather than to the standard input).If you do have a specific problem that you have, you could probably post back to this thread and I or someone else on this forum can help you out with a solution.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.