• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

intermediate C++ questions

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Robbiem01

Member
Joined
Feb 9, 2002
I'm pretty new to c++ but I have done other programming before and I just want to know of a good site that can show me stuff like opening windows, changing text color, taking input from the keyboard without making the user hit return, making the program pause untill any key is pressed and that kind of stuff that makes a program look better but isn't essencial. We havn't done classes yet but we just leared how to use struct and how to read and write from data files. Also, if you dont know of any sites but know how to do any of this stuff that would be great too. I could prob. figure it out if you give me some source code. Thanks in advance.
 
all the C++ i know is text-based/command-line/console
what's a window? :burn:
 
The programming you do is done in the starndard window because you have not specified which window mode you want to be in. I dont know how to open a new window (or close the standard window) but I have seen programs that do it at school. I'm gonna ask the programmer how he did it after spring break. The advantage of opening your own window is that you can change the font, color, size ... of text whenever you want. I cant believe nobody in this forum knows how to do this! Anyways i'll post back if I figure it out from a site so tha all you guys will know how.
 
There are lots of different ways to do this. You have to (well, probably not have to, but this is how we did it) use a GUI package to do all of this. It is basically like writing two programs in one. One 'program' processes all the underlying commands then passes them to the GUI interface. We used a GUI package by Carnegie Mellon called Amulet, but I think they may have stopped w/ that one. If you want to open a window that is traditionally like windows, you have to use Microsoft's GUI (I think it is called MSC??..don't really know though...never used it). As far as getting menu's and buttons and all that, you have to have a seperate function (using amulet) for each and then you have a set list of commands that you use in this function. It is fairly complicated to do all of this, and takes a fair amount of time...but then again, what programming doesn't take time.

There is no short way to tell you how to do all of this. The amulet we used can be found here. Good luck w/ it. Feel free to ask questions.
 
You didn't say what OS so I'll assume windows. You don't need any sort of GUI package. You can just call the windows API to make windows. All the ins and outs of this are fairly complicated, so I'd advise you to pick up the following book:
"Programming Windows, Fifth Edition", Charles Petzold, Microsoft Press, 1999. ISBN 1-57231-995-X.
It is VERY good and covers pretty much everything you need.
 
Back