How to Learn VC ++

Source: Internet
Author: User

Prerequisites:
1. Is VC a language?

VC is not a language, but an integrated development environment (IDE ). By using VC, You can compile the source program, compile the link, debug and run the program in one piece, which is very convenient. If you have learned
8086 the assembly language will surely be impressed by its vomiting operation and debugging methods :). So what programming language are we using in VC? Is C ++.

2. What is MFC? What is the relationship between VC and MFC?

People who often listen to VC talk about MFC. The name of a well-known book is "let alone MFC". What is MFC? We know that C ++ is an object-oriented Programming (OOP) language that uses
Classes encapsulated by others can greatly speed up software development. The MFC is a set of fully-featured and powerful classes provided by Microsoft. Its full name is
Yes: Microsoft Foundation Class. We usually refer to "Learning VC". The half content refers to learning the functions and usage of MFC. What about the other half? -
I can't tell you immediately, but I'm not impressed with it immediately :)

3. What is an API function?

For example, if you want to print a line in the middle of the computer screen: "If you want to do one thing, you must have a solution ". What will you do? Displaying anything on a display is essentially a hardware operation,
As a common coder, it is impossible or necessary to go deep into the hardware layer to implement this function. Fortunately, the system provides us with a series of functions, as long as we call these functions in C Language
And the rest of the work with hardware is done by the system. These functions are the legendary API functions, full name: Application programm
Interface (application Interface ). In the above example, you can first use the API function GetDC () to obtain the desktop DC, and then use the TextOut () function to output text. Things
In fact, to learn VC program design well, you must understand and master these Apis-
This is more than half of the content.

I. ideological preparation
It's really interesting. Do I have to prepare for learning a program development?

I have no intention to exaggerate the difficulty of learning VC, but it is an indisputable fact that VC is much more difficult to get started than VB. If you have completed VB in three weeks, it may take three months for VC
This ubiquitous difference in learning difficulties has led to a lot of people getting frustrated and eventually giving up. Of course, the specific time it takes is related to your original foundation and your individual efforts. I will talk about it later.
Knowledge. Now, I only want my friends to know that VC is hard to learn and I need to prepare for long-term learning.

Ii. Learning Process

Everyone wants to reach their destination through the shortest and best path. Is VC learning a good choice? However, there are some ways that cannot be bypassed. If you bypass them, your knowledge will become rootless grass, and you will continue to learn. The following lists the knowledge required to learn VC in sequence:


1. C ++ programming Basics

2. Windows Programming

3. learning and using MFC

If you see a fear, read "I. mental preparation" again.
Let me explain the relationship between these three knowledge points.

 


To learn VC, you must have C ++ basics. Learning VC without C ++ is purely nonsense. Speaking of this, I want to ridicule myself, because I used to learn VC on impulse when I was in my sophomore year and borrowed a few books from the library.
The book has been grayed out for more than half a month. I still don't know the cloud in the book, so I gave up. In retrospect, the reason for poor writing is that I have not learned VC, but the key is that my foundation is not enough.
Even ":" doesn't know what it means. So if you do not know C ++ yet, be sure to learn C ++ first.

If time is too short, you can quickly get it: At least you should understand the basic concepts of object-oriented programming, such as classes, objects, inheritance, and overloading.
Recommended Bibliography: C ++
Primer, Qian Neng's C ++ Programming Tutorial is also good.

 


With the foundation of C ++, we should learn about windows programming. This part mainly learns the use of a large number of API functions based on understanding the message mechanism. First, you need to understand
The event-driven mechanism of windows programs is to spend a lot of time learning the API functions provided by the system and use them for simple visual programming. There are thousands of API functions, but not
With fear, you only need to use the hundreds of commonly used functions. This part takes most of the time in your VC plan-and the return is quite remarkable. When you make great efforts to learn this part, you will
It is found that the basic knowledge of the next MFC part is easy to learn.

Note: A lot of people are afraid of this part of learning and choose to skip the past to directly learn MFC. My opinion on this is: not desirable.When you do not learn to go
Do not run when you are on the road; otherwise, it will often fall badly. Mr. Hou Junjie also said that "do not build a high platform in the sand. As a matter of fact, after you learn this part well, you will find that the introduction to MFC is not necessary at all.
Time spent. There are a lot of things in the world that need to be done. When you make enough effort, you can always do one thing (especially for technology) without looking for shortcuts, the ancients said, "Unfortunately,
The clever person is so self-defeating. "The Real shortcut is not to find a shortcut.
Recommended Bibliography: Petzold
"Widnows Program Design", has the Chinese version. Why do I only recommend this one? Because it is so classic, It is enough.


When you finally learned the part of windows program design, please allow me to congratulate you in advance and you will soon succeed. Now let's look at MFC. You will inevitably feel like this: Haha, this is not the right thing.
Is API function encapsulation? It is true that for beginners, it is nothing more than using MFC to create a dialog box or a single document program. There are only a few controls in it, and the operations on controls are mostly using API letters.
The difference is that these functions are encapsulated by MFC, which seems easier to use.
Recommended Bibliography: VC ++ technology insider and MFC

It is worth mentioning that there is a very good video tutorial on the Internet for learning MFC. Sun Xin
Lecture. I have read it, and I think he is really good at speaking about it. I can get started after finishing the first 10 lessons. This video has a total of 20 courses, with a size of 2 to 2 GB. If you are interested, you can buy a disk or download it with a value such as BT or donkey.



So far, you have mastered the use of API functions and MFC for simple visual program development. It is no longer a problem to train a simple database or network program. The long journey has taken the first step. Congratulations!

Iii. Q & A (FAQs)

Q: I don't know C language. Does it matter?
A: it does not matter. You just need to follow the 123 course described in [learning process.

Q: Which version of VC should I install?
A: The version is not important, just like the one you eat first.
IDE is widely used. If you have no idea how to recommend it, install VC ++ 6.0, preferably in English.

Q: C ++ and
Can I use VC to compile and debug windows programming?
A: Of course. The specific method for searching online is quite simple.

Q: The amount of VC code is too large. A simplest window requires hundreds of lines of code. Why?

A: This is the way VC is used. Simplicity and flexibility are inherent contradictions. VC tends to be the latter.

Q: What is MSDN? Do I need to install MSDN?

A: You can simply understand MSDN as a function reference manual. For VC programmers, without MSDN, It is unimaginable.

Q: What should I do if there are too many API functions and macro definitions that are hard to remember?

A: How many atoms does chemistry have in high school? It's hard to remember? However, I believe that many people remember the atomic weight of commonly used elements. Why? It's natural to remember how much you practice. Don't leave it alone.


Q: I have been studying VC for a while and think VC is too difficult. What should I do?
A: Thank you. This is the easiest question to answer: Stick to or give up.

Q: What is the key way to learn Vc in one sentence?
A: hand-written code, starting with the simplest program, programming, programming, and re-programming.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.