SDK programming

    SDK is the abbreviation of Software Development Kit, which means "software development kit" in Chinese. This is a very broad term, so to speak: A collection of related documents, examples and tools that assist in the development of a certain type of software can be called "SDK". Specific to our series of tutorials, we will only discuss a subset of the broad SDK - the SDK used to develop applications under the Windows platform.   

    Hehe, in fact, the above is just a general concept of SDK. Is it really that easy to understand what SDK is? I'm afraid it's not that simple! To explain what an SDK is we have to introduce the concepts of API, dynamic link library, import library, etc. Don't be afraid, it's just a few new terms. In fact, learning new knowledge is learning new terms, new concepts and new terms.   

    The first thing to contact is the "API", which is the Application Programming Interface, which is actually a calling interface left by the operating system to the application. The application makes the operating system execute the command (action) of the application by calling the API of the operating system. In fact, the concept of API existed as early as the DOS era, but the API at that time was provided in the form of interrupt call (INT 21h), and the applications running under DOS directly or indirectly used the function of the operating system through interrupt calls. For example, after setting AH to 30h and calling INT 21h, the version number of the DOS operating system can be obtained. In Windows, system APIs are provided in the form of function calls. The same is to get the version number of the operating system, in Windows all you have to do is to call the GetVersionEx() function. It can be said that the DOS API is "Thinking in assembly language", while the Windows API is "Thinking in high-level language". DOS APIs are part of system programs, they are loaded into memory with the system and their entry can be found through the interrupt vector table, so what about Windows APIs? To explain this problem, we have to introduce the concept we will introduce below - DLL.   

DLL (note that it's different from C#!), the Dynamic Link Library. We often see some files in .dll format. These files are dynamic link library files, which are actually an executable file format. Unlike .exe files, .dll files cannot be executed directly. They are usually loaded by .exe during execution and contain some resources and executable code. In fact, the three major modules of Windows are provided in the form of DLLs (Kernel32.dll, User32.dll, GDI32.dll), which contain the execution code of API functions. In order to use the API function in the DLL, we must have the declaration of the API function (.H) and its import library (.LIB). The prototype declaration of the function is not difficult to understand, so what is the import library used for? Let's understand it this way for now: Import libraries are used to find entry points for APIs in DLLs.   

    Therefore, in order to use the API functions, we must have the .H and .LIB files corresponding to the API, and the SDK is a "toolkit" that provides a complete set of related files, examples and tools required for developing Windows applications. So far, we have really explained what the SDK means.   

    Because the SDK contains the necessary information to use the API, people often refer to the development method of writing Windows applications using only the API as "SDK programming". The API and SDK are necessary to develop Windows applications, so other programming frameworks and class libraries are built on them, such as VCL and MFC, although they have a higher level of abstraction than "SDK programming" , but this does not prevent them from directly calling API functions whenever they need it.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327106357&siteId=291194637