Win32 programming, windows api, MFC and VC ++

Source: Internet
Author: User

C ++ is a programming language. programs written in C ++ can be compiled into executable programs using a C ++ compiler. There are many C ++ compilers.

VC is a programming tool software that integrates the C ++ compiler and editing environment. Its full name is Virsual C ++, that is, "visual c ++ programming tools ".

MFC is a basic library provided by Microsoft. It encapsulates APIs in WINDOWS. for developers, it is easier to use MFC than to directly use Windows APIs. (All Windows applications must be implemented using Windows APIs.) MFC also provides a good application framework, the most prominent of which is the "document/View" structure.

The C ++ language has nothing to do with the operating system environment. Because Windows operating systems are too popular, we are generally developing applications based on Windows operating systems.

Currently, many programming languages and environments are used to develop Windows applications. In C ++ programming environments, VC is easy to use, especially for developing Windows applications, in addition, VC provides the best support for MFC Application Development (both Microsoft products). Therefore, a considerable number of people use MFC to develop Windows applications on VC.

The "windows Programming and windows API programming" you mentioned is still a little different. The former generally refers to developing Windows applications, while the latter emphasizes directly calling Windows APIs for programming. The former includes the latter, currently, Windows APIs are rarely programmed, but many class libraries encapsulated with APIs are developed, such as MFC.

In short, there is no direct relationship between VC, C ++, and MFC. To say something is:
1. VC supports the C ++ programming language and the Development of Windows applications using MFC
2. MFC itself is a C ++ class library

In addition:
1. VC can also develop C Programs, so you don't need to use MFC at all.
2. VC can use C or C ++ to develop non-Windows programs, such as Dos programs.

If you want to use C ++ to compile a Windows program, we recommend that you first learn C ++ well and then try to develop a Windows program using the MFC framework in the VC environment. For details, referVirsual C ++ technology insider (I cannot figure out how many editions are available now.) Of course, you have to have one.MFC Reference ManualYou can search for descriptions of classes and class member functions at any time (either with MSDN ).

At the beginning, you should not be too nervous or eager to seek success. You should first clarify some concepts andMessage Mechanism of the Operating SystemIt is necessary to work harder to understand. With these foundations, it will be easier and easier to practice.

Well, write this first, hoping to help you.

**************************************** *******************

Supplementary answer:

If you want to learn Windows API programming, it is also appropriate to use VC. When creating a project, select Win32 app and do not use MFC.

Windows API programming must use a programming language. C or C ++ is a good choice, as long as you do not use MFC in the program, instead, the most basic APIs provided by windows can be called Window API programming.

As for the development environment, VC is quite good (although a little complicated). You can use VC to generate an application framework for you, which can greatly improve the development efficiency, or you can use winmain () start writing at (that is, the only entry point of the application, relatively speaking, non-Windows programs start with main (), just like writing DOS programs.

In short, Windows API programming is not complex. You can look at a few simple examples and then slowly increase the complexity of code and application. If you use VC, let VC help you generate a simple application framework, and you can run it without writing a sentence of code, then you can take a closer look at the source code generated by VC for you, and then you can start to add some new code on this basis.

During programming, the default value of VC is C ++ by default. As for C or C ++, you can use C or C ++. Most people use it together, c ++ fully contains C. Currently, C and C ++ are generally distinguished. It is nothing more than simply checking whether a class is used or whether a reference (&) is used... We recommend that you use C ++ to understand the basic C syntax and concepts.

I don't know how you are working. You can learn the following content first:
1. Programming Language
2. Familiar with Windows API and understand WINDOWS Message Mechanism
3. VC development environment

Now, we can do the following:
1. Install a VC
2. Try to touch VC and use VC to create the simplest application framework for you (do not use MFC)
3. One hand uses a programming language book and one hand uses a Windows API quick reference manual.
4. Start. What are you waiting! Compile and run!

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.