|
Category: Computers & Technology : Programming
Visual C++ is one of the most widespread and important languages available today for developing applications for the Windows operating system. Developed and sold by Microsoft, Visual C++ is actually an entire development environment. (FYI, the latest version in stores is 6.0)
What this means is that Microsoft first took C++, which is a common, powerful programming language that can be used to write any kind of application for any kind of operating system.
They then devised a set of functions written in C++ that allow a programmer to control the Windows environment. For example, one function might draw a window on the screen while another might print text in that window. This set of functions is called the MFC, or Microsoft Foundation Class. (For the more advanced out there, the MFC functions wrap the Windows API functions, and hence make them easier to use and object-oriented as well).
Finally, they developed an application that allows a programmer to easily create code using these MFC functions. This application is what you actually buy and install on your computer.
To begin to understand how to use Visual C++, you must first be familiar with using C or C++ in a text-based environment. If you're not, I suggest first picking up a good introductory book on programming in C++ at Barnes and Noble.
Visual C++ is more complicated than programming in C++ on a text based system for three main reasons.
1. Windows programs are event-driven.
If you're used to programming in C++ on a Unix system, for instance, you're used to writing a Main function that controls the execution of your program. The Main function starts at the top and moves to the bottom, executing each line of code in turn. This makes program execution very easy to follow.
Windows programs, on the other hand, are driven by events. If the user clicks the mouse in a certain place or selects a certain menu option, the program performs a certain task, etc. You can visualize an event-driven program as a collection of functions that exist in no particular order, and each function is executed by a particular event. This is incredibly confusing and frustrating because you don't know where a program starts or ends.
2. The MFC
The MFC is extremely complicated and large. Every little thing you do in Windows, like printing text, displaying an icon etc. requires you to research and learn obscure functions. Be prepared to use online help extensively.
3. Visual C++ is object oriented.
If you're already a C++ programmer, you're used to objected-oriented programming, but if you're a C programmer you may not be. Object orientation means that every function and variable in a program exist as part of organizational units called objects. For instance, a database program might contain an object called Record. The Record object might contain three variables called Name, Address and Phone Number, and a bunch of functions that allow users to enter and change these pieces of information. Each time a user adds a new record, a new instance of the Record object is created. An object can contain child objects, which inherit all the properties of the parent object and add their own as well.
Understanding object orientation is critical because the MFC functions are all contained within objects called MFC Classes.
Ok, so how do I use this damn thing, you might ask?
Well, to begin with, Visual C++ helps by using wizards to generate an awful lot of code for you. When you install Visual C++, you can create in about 3 minutes a basic windows application which you can then compile and execute. The application will have basic functionality--you can maximize and minimize it, it has a menu bar and a File, Edit and Help menu. It just doesn't do anything. It's up to you to add the code that makes it a database, a word processor, a game, etc.
The downside of this is that a lot of the functionality is hidden from immediate view. You WILL go bugsh*t trying to figure out, for instance, where the @&&%%#% code is that draws the window frame for your application.
The best way to learn is to go buy the software, install it, and get some good books. Here are my recommendations.
1. Learn Microsoft Visual C++ Now by Chuck Sphar. Buy this first and read it and work through it carefully. (This book contains a working version of Visual C++ 6.0, good for learning but lacks a lot of the online documentation you get when you buy the program separately. If you are going to do any serious programming, buy the software).
2.Teach Yourself Visual C++ in 24 Hours by Mickey Williams. Buy this and work through it next. It may repeat a bit, but will cement your knowledge.
3. Visual C++ Programming Blue Book by Stephen Gilbert. This is also a beginners text, but presents some more advanced topics.
These are all available at Barnes and Noble.
Finally, try and find a patient friend who knows what they're doing. But don't get discouraged. The fun of succeeding with this language will offset the difficulty.
Good luck.
|
Submitted By
|
David Goldbrenner |
|
Description
|
Programmer |
|
Web Page
|
not
available |
Other Articles in this Category
How to Learn Database/SQL Technology
by Ravi Iyer
Introduction to Programming- Concepts and Theory
by Asha Goldberg
Other Sites
Storkin.com - Baby and
Pregnancy Tips and Discussion
Health Articles
Menopause
Symptoms
HIV/AIDS
Symptoms
West Nile
Symptoms
Diabetes
Symptoms
Pregnancy
Symptoms
Tech Sites
Dell DJ Hacks
Read other Articles -
click here.
|