Debugging and viewing of the library of VC ++ dynamic link library (DLL) Programming

Source: Internet
Author: User

Debugging and viewing of the library of VC ++ dynamic link library (DLL) Programming

Before entering the detailed description of various DLL types, it is necessary to introduce the debugging and viewing methods of library files, because we will face a large number of example projects from the next section.

Because the library files cannot be executed separately, when you press F5 (start debug mode execution) or CTRL + F5 (run) for execution, the dialog box shown in 3 is displayed, the user is required to enter the path of the executable file to start the execution of the library function. At this time, we can debug the library by entering the path of the EXE file to call the library. The debugging skills are the same as that of common application projects.

There is usually a better way to debug than the above practice, that is, place the library project and application project (the project that calls the Library) in the same VC work zone, and only debug the application project, set a breakpoint at the statement of the function in the application project call library, and press F11 after execution, so that the function in the library is entered in a single step. The libTest and libCall projects in section 2nd are placed in the same workspace, as shown in project structure 4.

The above debugging method is the same for static and dynamic link libraries. Therefore, all the source code provided for download in this article contains the Library Project and the call library project, both of which are included in a work zone, which is the intention of the author to provide such package download.

The export interface in the dynamic link library can be viewed using the Depends tool of Visual C ++. Let's use Depends to open user32.dll in the system directory, right? There are several versions of MessageBox in the red circle! It actually exists here. It turns out to be here!

Of course, the Depends tool can also display the DLL hierarchy. If you use it to open an executable file, you can see which DLL is called by this executable file.

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.