Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does the dll file mean?

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you what the dll file refers to. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can gain something through the detailed introduction of this article.

DLL is the abbreviation of Dynamic Link Library, which means dynamic link library. DLL files are generally stored in the C:WindowsSystem directory. DLL is a library that contains code and data that can be used by multiple programs simultaneously.

In Windows, many applications are not a complete executable file, they are divided into some relatively independent dynamic link libraries, namely DLL files, placed in the system. When we execute a program, the corresponding DLL file is called. An application can have multiple DLL files, and a DLL file may be shared by several applications. Such DLL files are called shared DLL files.

For example, in the Windows operating system, Comdlg32 DLL performs common functions related to dialog boxes. Therefore, each program can use the features contained in the DLL to implement the Open dialog box. This helps to promote code reuse and efficient use of memory.

By using DLL, the program can be modular and consists of relatively independent components. For example, an accounting program can be sold by module. Each module can be loaded into the main program at run time (if the corresponding module is installed). Because the modules are independent of each other, the program loads faster, and the module loads only when the corresponding function is requested.

In addition, updates can be more easily applied to individual modules without affecting the rest of the program. For example, you might have a payroll calculation program, and the tax rate changes every year. After these changes are quarantined in DLL, you can apply updates without having to regenerate or install the entire program.

Some files implemented as DLL in the Windows operating system

1. ActiveX control (.ocx) file

An example of an ActiveX control is a calendar control, which allows you to select a date from a calendar.

2. Control panel (.cpl) file

An example of a cpl file is an item located in the control panel. Each item is a dedicated DLL.

3. Device driver (.drv) file

An example of a device driver is a printer driver that controls printing to a printer.

Advantages of using DLL in a program

1 use fewer resources

When multiple programs use the same library, DLL can reduce the amount of repetition of code loaded on disk and physical memory. This can greatly affect not only the programs running in the foreground, but also other programs running on the Windows operating system.

2 popularizing modular architecture

DLL helps facilitate the development of modular programs. This can help you develop large programs that require multiple language versions or programs that require modular architecture. An example of a modular program is an accounting program with multiple modules that can be loaded dynamically at run time.

3 simplify deployment and installation

When a function in DLL needs to be updated or fixed, deploying and installing DLL does not require re-establishing the program's link to that DLL. In addition, if multiple programs use the same DLL, then multiple programs will benefit from the update or fix. This problem may occur more frequently when you use a third-party DLL that is updated or fixed regularly.

1. How to know which DLL files are used by an application

Right-click the application and choose Quick View from the shortcut menu, and you will see its use of DLL files in the Import Table column of the Quick View window.

2. How to know that DLL files are used by several programs

Run Regedit, enter the HKEY_LOCAL_MACHINESoftwareMicrosrftWindowsCurrentVersionSharedDlls sub-key to view, its right window shows all DLL files and related data, in which the data right parentheses in the number that is used by several programs, (2) is used by two programs, (0) means no program use, can be deleted.

3. How to solve the situation of missing DLL files

Sometimes when you uninstall a file, it will remind you that deleting a DLL file may affect the operation of other applications. So when you uninstall the software, you may mistakenly delete the shared DLL file. Once a missing DLL file occurs, if you can determine its name, you can find the DLL file in Sysbckup (system backup folder) and copy it to the System folder.

If this doesn't work, there will always be "* dll files missing …" when the computer starts up. In the prompt box, you can run Msconfig in "start / run". After entering the system configuration utility dialog box, click and select the "System.ini" tab to find the missing DLL file so that it is not selected, so that there will not be an error prompt when you boot.

The function of rundll is to call Windows's dynamic link library in a command line.

Rundll32.exe differs from Rundll.exe in that the former is a 32-bit link library, while the latter is a 16-bit link library. Rundll32.exe is a program specifically used to call dll files.

If you use Win98,rundll32.exe, it usually exists in the Windows directory.

If you use WinXP,rundll32.exe, it usually exists in the WindowsSystem32 directory.

If it is in another directory, it may be a Trojan that will disguise itself as rundll32.exe.

DLL troubleshooting tool

There are several tools you can use to help you solve DLL problems. Here are some of the tools.

1 、 Dependency Walker

The Dependency Walker tool can recursively scan for all dependent DLL used by the program. When you open a program in Dependency Walker, Dependency Walker performs the following checks:

Dependency Walker checks to see if DLL is missing.

Dependency Walker checks for invalid program files or DLL.

Dependency Walker checks whether the import function and the export function match.

Dependency Walker checks for circular dependency errors.

Dependency Walker checks to see if there is a module that is invalid for a different operating system.

By using Dependency Walker, you can record all the DLL used by the program. This may help avoid and correct DLL problems that may occur in the future. When you install Microsoft Visual Studio 6.0, Dependency Walker will be located in the following directory:

Drive\ Program Files\ Microsoft Visual Studio\ Common\ Tools

2 、 DLL Universal Problem Solver

The DLL Universal Problem Solver (DUPS) tool is used to audit, compare, record, and display DLL information. The following table describes the utilities that make up the DUPS tool:

Dlister.exe: this utility enumerates all the DLL on your computer and records this information to a text file or database file.

Dcomp.exe: this utility compares the DLL listed in two text files and produces a third text file that contains the difference.

Dtxt2DB.exe: this utility loads text files created by using the Dlister.exe utility and the Dcomp.exe utility into the dllHell database.

DlgDtxt2DB.exe: this utility provides a graphical user interface (GUI) version of the Dtxt2DB.exe utility.

Type of DLL

When you load DLL in your application, you can use two link methods to call the exported DLL function. These two linking methods are dynamic linking at load time and dynamic linking at run time.

1. Dynamic linking at load time

In dynamic linking at load time, the application makes an explicit call to the exported DLL function as if it were a local function. To use dynamic linking at load time, provide the header file (.h) and the import library file (.lib) when compiling and linking the application. When you do this, the linker provides the system with the information needed to load the DLL and parses the location of the exported DLL function at load time.

2. Run-time dynamic linking

In the runtime dynamic link, the application calls the LoadLibrary function or the LoadLibraryEx function to load the DLL at run time. After the DLL is successfully loaded, you can use the GetProcAddress function to obtain the address of the exported DLL function to be called. When using runtime dynamic links, you do not need to use import library files.

Characteristics of Win32 DLL

Win32 DLL is very different from Win16 DLL, which is mainly determined by the design idea of the operating system. On the one hand, in Win16 DLL, the entry point function and exit point function (LibMain and WEP) are implemented respectively, while in Win32 DLL they are implemented by the same function DLLMain. This function is called whenever a process or thread loads and unloads DLL. Its prototype is

BOOL WINAPI DllMain (HINSTANCE hinstDLL,DWORD fdwReason, LPVOID lpvReserved)

Among them, * * parameter represents the instance handle of DLL; the third parameter is retained by the system

The second parameter is mainly introduced here, which has four possible values:

DLL_PROCESS_ATTACH (process loading)

DLL_THREAD_ATTACH (thread loading)

DLL_THREAD_DETACH (thread offload)

DLL_PROCESS_DETACH (process offload)

The value of this parameter passed in can be distinguished in the DLLMain function, and the DLL can be initialized or cleaned up according to different parameter values. For example, when a process loads a DLL, the second parameter assigned to DLL is DLL_PROCESS_ATTACH, and you can initialize specific data based on this parameter.

On the other hand, in Win16 environment, all applications are in the same address space; while in Win32 environment, all applications have their own private space, and the space of each process is independent of each other, which reduces the interaction between applications, but also increases the difficulty of programming. As you know, in a Win16 environment, the global data of DLL is the same for every process that loads it. However, in the Win32 environment, the situation has changed. When a process loads DLL, the system automatically maps the DLL address to the private space of the process, and copies a copy of the global data of the DLL to the process space, that is to say, each process has the same global data of DLL, but its value is not necessarily the same.

Therefore, if you want to share data in multiple processes in a Win32 environment, you must make the necessary settings. In other words, the data that needs to be shared is separated, placed in a separate data segment, and the properties of the segment are set to sharing.

The above is what the dll document refers to. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report