什么是dll? [英] What is a dll?

查看:170
本文介绍了什么是dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个非常可爱的问题,但是在今天的Web应用程序开发世界中,许多程序员不需要处理dll,因此不用去了解他们的目的。



那么什么是dll?


  1. 它用于什么?


  2. 如何创建一个?

  3. 在什么情况下创建一个合适的?

我被告知,dll用于存储函数库,但超出此范围,我不太了解。希望有人可以启发我,所以我终于可以停止想知道Windows目录中的所有这些.dll文件在做什么。

解决方案

DLL是动态链接库。它是代码和/或数据的集合,可以由多个应用程序(或其他库/模块)使用。因此,例如,处理文件的常见方法,使用GUI组件等在库中可用,因此几个应用程序可能使用相同的功能。这不仅减少了多次构建相同的东西的需要,而且还确保了例如。通用对话框在应用程序之间是相同的。



库可以在运行时加载,从而在不同的并发应用程序之间共享。这被称为动态链接。



在某些情况下,库可以包含在应用程序本身中。这被称为静态链接。由于不同的应用程序将分别加载相同的DLL副本,因此静态链接可以轻松实现部署,从而实现灵活性的部署。



然而,静态链接并不总是一个选项。例如。您无法静态链接.NET应用程序。用户必须拥有.NET库才能运行.NET应用程序,并在运行时加载库(或它们在.NET中调用的程序集)。



DLL由用于创建应用程序的相同工具创建。具体细节在很大程度上取决于所使用的工具。


This may be a very noobie question, but in today's world of web app development many programmers don't need to deal with dll's much, and thus don't bother to learn about their purpose.

So what is a dll?

  1. What is it used for?
  2. How does it work?
  3. How do you create one?
  4. In what situations is creating one appropriate?

I've been told that dll's are used to store libraries of functions, but beyond that I don't know much. Hopefully someone here can enlighten me so I can finally stop wondering what all those .dll files in my Windows directory are doing.

解决方案

A DLL is a dynamic link library. It is a collection of code and/or data, which may be used by several applications (or other libraries/modules).

So for instance common methods to process files, work with GUI components etc. are made available in libraries so several applications may use the same functionality. This not only reduces the need to build the same stuff multiple times, but it also ensures that e.g. common dialogs are the same between applications.

Libraries can be loaded at runtime and thus shared between different concurrent applications. This is called dynamic linking.

In some cases the library can be included within the application itself. This is known as static linking. Static linking makes deployment easier at the cost of flexibility as different application will each load the same copy of the DLL.

However, static linking is not always an option. E.g. you can't statically link a .NET application. The user must have the .NET libraries in order to run a .NET application and libraries (or assemblies as they are called in .NET) are loaded at runtime.

DLLs are created by the same tools used to create applications. The specific details depend very much on the tools used.

这篇关于什么是dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆