APIs and sdks in Visual C ++ programming)

Source: Internet
Author: User
Keyword: Visual C ++ programming API SDK

We are writing standard CProgramYou can call various library functions to complete some functions. The most commonly used C library function for beginners is printf, these library functions are provided by the compiler vendor you are using. On Windows, similar functions are available for calling. The difference is that these functions are provided by the Windows operating system itself.

Windows provides a variety of functions to facilitate the development of Windows applications. These functions are interfaces provided by the Windows operating system for application programming.
(Application Programming
Interface (API. The API function we call when writing a Windows program is the function provided by the system.
The windows. h header file is declared.

The Windows operating system provides more than 1000 types of API functions. As a developer, remember all these function calls.
The syntax used is almost impossible. So how can we better use and master these functions? API functions provided by Microsoft are mostly meaningful combinations of words. Each word is capitalized, for example
Createwindow: You can guess from the function name. This function is used to create a window for the program. Others, such as showwindow (used to display a window ),
Loadicon (used to load icons), sendmessage (used to send messages), etc. The exact spelling and call Syntax of these functions can be found in msdn.

You can understand msdn as a help system provided by Microsoft to developers, including a large number of development documents and technologies.ArticleAnd examplesCode. Msdn contains comprehensive information, not only can programmers
Msdn can be used to assist development and learning to improve yourself. For beginners, learning to use msdn and learning from it is a required skill.

During program development, there is no need to memorize the call syntax and parameter information of the function, as long as we can quickly find the required information from msdn, and so on, these functions will naturally be remembered.

We often hear about Win32 SDK development. What is the SDK. The full name of the SDK is software development.
Kit. If we want to develop a call center now, the manufacturer will provide the voice card SDK while purchasing the voice card, so that we can program the voice card. This
Generally, sdks contain APIs, help documents, user manuals, and auxiliary tools of voice cards. That is to say, the SDK is actually a collection of resources required for development. Readers should understand
The meaning of the Win32 SDK, that is, the software development kit under the Windows 32-bit platform, including API functions, help documentation, and some auxiliary development tools provided by Microsoft.

Tip: API and SDK are widely used terms and do not specifically refer to a specific API or SDK, for example, voice card API, voice card SDK, Java API, Java SDK, etc.

View the source of this Article

I often see such posts in technical forums: "What is SDK ?", "Could you tell me what the SDK is ?"......

Actually, the SDK is the software development kit.
The Chinese abbreviation is "software development kit ". This is a widely used term. It can be said that the collection of documents, examples, and tools used to assist in the development of a certain type of software can be called
"SDK ". In this series of tutorials, we will only discuss a subset of the general SDK-the SDK used to develop applications on the Windows platform.

In fact, the above is just a general concept of the SDK. Is it so easy to understand what the SDK is? I'm afraid it's not that easy! To explain what the SDK is
We have to introduce
API, dynamic link library, import/export warehouse, and so on. ^ _ ^, Don't be afraid, that is, just a few new terms. I realized at the end of college that learning new knowledge is actually learning new terms and concepts.
Concepts and new terms.

The first thing you need to contact is "API", that is, application programming.
Interface is actually a call interface left by the operating system for the application.
The operating system executes the commands (Actions) of the application ). In fact, as early as the DOS era, there was an API concept, but at that time the API was in the form of an interrupt call (int
21 h) provided, all applications running under DOS use the operating system functions directly or indirectly through interrupt calls. For example, if ah is set to 30 h, int 21 H is called.
The version number of the DOS Operating System is displayed. In Windows, system APIs are provided through function calls. Obtain the version number of the operating system.
In Windows, all you need to do is call the getversionex () function. In this case, the dos api is "Thinking in
Assembly language, while Windows API is "thinking in advanced language. DOS API
Is part of the system program. They are loaded into the memory together with the system and can find their entry through the interrupt vector table.
What about it? To understand this problem, we have to introduce this concept-DLL.

DLL (also an abbreviation, I feel that there are many acronyms in the IT industry), that is, dynamic link
Library (dynamic link library ). We often see files in. dll format. These files are dynamic link library files, but they are also executable files. With. exe
Files are different. DLL files cannot be directly executed. They are usually imported by. EXE during execution, which contains some resources and executable code. In fact, Windows
The three modules are provided in the form of DLL (kernel32.dll, user32.dll, gdi32.dll), which contains the API
Function Execution Code. To use the API functions in DLL, you must have an API
The declaration of function (. h) and its import and export (. Lib) are not difficult to understand. What is the purpose of importing and receiving functions? For the moment, we should first understand that import and export is
Used to find the API entry point.

Therefore, in order to use API functions, we need to have corresponding APIs. H and. the SDK provides a complete set of related files, examples, and tools required to develop Windows applications ". So far, we have explained the meaning of the SDK.

Because the SDK contains the required information for using APIs
The development method of an application is called "SDK programming ". While API and SDK are developed for Windows
So other programming frameworks and class libraries are built on them, such as VCL and MFC.
Programming "to have a higher degree of abstraction, but it does not prevent them from directly Calling API functions whenever necessary.

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.