APIs and DLLs

Source: Internet
Author: User

APIThe API (application programming Interface, Application programming Interface) is actually a calling interface that the operating system leaves to the application, which enables the operating system to execute commands (actions) of the application by invoking the operating system's APIs. In fact, early in the DOS era has the concept of the API, but at that time the API is in the form of interrupt invocation (INT 21h), the application in DOS run directly or indirectly through the interrupt call to use the operating system functions, such as to set AH to 30h after the call INT 21h can get do The version number of the S operating system. In Windows, however, the system API is provided in the form of a function call. Also get the OS version number, all you have to do in Windows is call the GetVersionEx () function. As you can say, Dosapi is "thinking in assembly language", while the Windows API is "Thinking in advanced languages". Dosapi is part of the system program, they are loaded into memory with the system and can find their portals by interrupting the vector table, what about Windows API? To understand this problem, we have to introduce the concept--dll.DLLDLL, the dynamic link library. Files with a large number of. dll formats in a Windows environment, which are dynamic link library files, are also an executable file format. Unlike the. exe file,. dll files cannot be executed directly, they are usually performed by the. exe in the fashion, with some resources and executable code. In fact, the three modules of Windows are provided in the form of DLLs (Kernel32.dll,user32.dll,gdi32.dll), which contains the API functions of the execution code. In order to use API functions in  DLL , you must have the declaration of the API function (. H) and its import library (. LIB), the import library can be understood first: the import library is used in order to find the API entry point in the DLL. In order to use the  API  function, we need to have a corresponding API. H and. LIB file, and the SDK provides a complete set of "toolkits" for the relevant files, samples, and tools needed to develop Windows applications. The SDK contains the necessary information to use the API, so people often use the API only to write  Windows  application development Way is called "SDK programming". While APIs and SDKs are essential for developing Windows applications, other programming frameworks and libraries are built on top of them, such as VCL and MFC, although they have a higher degree of abstraction than "SDK programming", which does not prevent them from invoking API functions at any time when needed.

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.