Talk:Dynamic-link library

From Wikipedia, the free encyclopedia

which places the DLL's location and its globally unique ID (GUID) in the registry. Programs can then use the DLL by looking up its GUID in the registry to find its location.

This is wrong DLLs don't have GUIDs. A DLL can have one or more components inside and those are the ones that have unique GUIDs. For example:

[HKEY_CLASSES_ROOT\CLSID\{00000105-0000-0010-8000-00AA006D2EA4}\InprocServer32] @="C:\\Program Files\\Common Files\\Microsoft Shared\\DAO\\dao360.dll"

[HKEY_CLASSES_ROOT\CLSID\{00000106-0000-0010-8000-00AA006D2EA4}\InprocServer32] @="C:\\Program Files\\Common Files\\Microsoft Shared\\DAO\\dao360.dll"

different GUIDs pointing to the same DLL. --87.196.95.140 11:05, 22 January 2007 (UTC)


User:67.10.10.66 introduced many small factual errors in his (obviously good-faith) edits, so I decided to revert them and merge the valuable additions gradually.

E.g. DLLs aren't limited to PE files (they were NE in 16-bit Windows); SYS, DRV and FO? have nothing to do with them, except they are also PE; ordinals are mandatory, while names aren't; and so on.

I expect to edit the article further. --tyomitch 06:55, 28 November 2005 (UTC)

Contents

[edit] TODO

The article still needs information on at least the following points.

  • DLL search paths
  1. directory of executing application
  2. current directory (if different from executing app)
    • May add additional directories here with SetDllDirectory
    • GetDllDirectory retrieves a list of these paths.
  3. Windows system directory
  4. 16-bit windows system directory (obsolete)
  5. Windows directory (GetWindowsDirectory)
  6. Directories in the PATH environment variable
  • SetDllDirectory(NULL) resets the search path to the defaults.
  • DLL main entry point
    • Notifications
      • DLL_PROCESS_ATTACH
      • DLL_PROCESS_DETACH
      • DLL_THREAD_ATTACH
      • DLL_THREAD_DETACH
    • DisableThreadLibraryCalls disables DLL_THREAD_ATTACH AND DLL_THREAD_DETACH notifications.
  • DLL process and thread interaction and safety
  • Semi-standard exported functions
    • HRESULT CALLBACK DllGetVersion(DLLVERSIONINFO *)
  • #pragma comment(lib, "Example.lib")
  • Delay loading DLLs (lazy binding)
    • #pragma comment(lib, "/DelayLoad:Example.dll")
  • DLLs in Delphi
    • Compiler and language considerations
      • Real project file contents... - ie exports section can be put anywhere, not exactly at the end
      • Some words about Delphi's specific data type string in libraries (Can be used inside, but when passed in parameter or result, BORLANDMM.DLL must be included to the project. How to obtain this)
    • Examples
      • Other directives like index, name, resident
      • Calling conversions (why cdecl??? stdcall is default, even if there are only soft differences)
      • Using dll without external directive (LoadLibrary(...), GetProcAddress(...)...)

[edit] Requested move

There's just one thing called Dynamic-Link Library; no disamb needed disamb, if necessary, should go by some other name. --tyomitch 09:19, 4 December 2005 (UTC)


Add *Support or *Oppose followed by an optional one sentence explanation, then sign your vote with ~~~~
  • Support. There is no usage outside of computing, and there are probably several orders of magnitude more people who will use dynamic link library in the context of Microsoft DLLs. Jsmethers 22:11, 4 December 2005 (UTC)

[edit] Discussion

  • The article was previously moved from Dynamic-Link Library to Microsoft Dynamic Link Library. This is a request to move it back. Most references have already been changed to point to the new locations. Even before the move, there were a large number if errors in the use of Dynamic Link Library. These errors clearly show there is ambiguity in the use of Dyanmic-Link Library alone.
    • Some used it in the context of Microsoft's implementation and pointed to the generic shared library page, which contains information about the concept of dynamic linking used in libraries.
    • Some used it in the context of dynamic linking used in libraries and pointed to the page on Microsoft's implementation.
Please, give an example of such usage. --tyomitch 09:16, 4 December 2005 (UTC)
The links in these articles should simply be fixed. The addition of a disambiguation line at the top of the Dynamic Link Library page should be sufficient reminder to prevent erroneous linking. Jsmethers 22:11, 4 December 2005 (UTC)
  • Microsoft uses both Dynamic Link Library and Dynamic-Link Library throughout their documentation.
But never Dynamically linked library; that one is more suitable for a disamb page, IMO. --tyomitch 09:16, 4 December 2005 (UTC)
  • This change is more or less a focus on a noun-phrase used within the Microsoft subfieled of computing. Microsoft should be added to denote this context.
Microsoft doesn't calls it Microsoft Dynamic Link Library; it's a made up name. --tyomitch 09:16, 4 December 2005 (UTC)
Microsoft also does not call Windows Microsoft Windows. The context is assumed. The problem is one of how much context should be in the title of a wikipedia article.
FWIW, it does. Run "winver" and see what it says. --tyomitch 13:24, 5 December 2005 (UTC)
The article should be called by the most common use (by orders of magnitude), and a friendly disambiguation link should be added at the top. Jsmethers 22:11, 4 December 2005 (UTC)
  • It focuses on adjective versus adverb and verb tenses. One of the following permutations may be used when writing and speaking about dynamic link libraries.
    • dynamic link library
    • dynamically linked library
    • dynamic linking library
    • dynamically linking library
I cannot find an official policy regarding the use of disamb pages, but usually the most common use of a word bypasses disamb, and links to a disamb page in its first line. Cf. Plasma and Plasma (disambiguation); Laser and Laser (disambiguation); etc. --tyomitch 09:16, 4 December 2005 (UTC)
See disambiguation, it's a guideline. The most common name used when searching wikipedia should be used as the title of the article. Such searches should not go directly to a disambiguation page.
  • This article should be moved back.
  • A friendly link should be placed at the top of the page which points to the disambiguation page.
  • The current disambiguation page should be moved to Dynamically linked library or Dynamic link library (disambiguation).
  • The other permutations should probably redirect to the disambiguation page.
  • A seperate article on the concept of dynamic linking should be created.
Jsmethers 22:11, 4 December 2005 (UTC)
  • To put this requested move in context, it would be like asking the Microsoft Windows be moved to simply Windows because Microsoft Windows is commonly refered to as just Windows in the Microsoft community.
Windows did redirect to Microsoft Windows since June 11. Then on September 16, an anon came and changed it into a disamb page without any discussion. --tyomitch 09:16, 4 December 2005 (UTC)


  • The article Dynamic link library is now a redirect to Microsoft Dynamic Link Library. There may be no need to move this article anymore unless it is desired that the word Microsoft be taken out. In fact, it may be desireable to leave it in this state so that in the furture someone will not come along and move the article again, but simple change the redirect.

Jsmethers 01:16, 6 December 2005 (UTC)

I believe that the article should be moved back, namely because the official (per Microsoft Manual of Style for Technical Publications) spelling-out of DLLs is dynamic-link library. (What's more interesting, it's all-lowercase there.) If anyone else decides to participate in this discussion, he is welcome; the discussion is open to everybody. --tyomitch 17:46, 6 December 2005 (UTC)
I moved the article to Dynamic-link library, which happened to be free. In case this is controversial (which is unlikely, given consensus with User:Jsmethers and no concern from others), perhaps a prior discussion here would be better than breaking out another move conflict. --tyomitch 18:00, 6 December 2005 (UTC)
bohan 2006-02-04
This is a boring terminology versus lexicography debate..
If i understand it correctly, in wikipedia, disambiguation pages are used when a term may refer to several different concepts, and redirections are used when a term is a synonym for a "preferred", unambiguous term that refers to only one concept. When there is no preferred term, or when the preferred term does not refer to only one concept, the wikipedia system doesn't work anymore. In the case of this page, it only talks about the concept of dynamically loaded libraries in the "domain" of Microsoft's operating system, while the concept stays the same on all systems. Since it is very probable that someone searches the term used as the title of this article while looking for a more general explanation of the concept, i think it should at least refer to Dynamic library (disambiguation) or Dynamic library or simply the broader concept of Library (computer_science) (there really is mess on the former two links).

[edit] What is dll and why is it bad for my memory?

Does "disabling caching of dll into memory" help and why? I have too little RAM already and need it used as efficiently as possible. And how to do that?

  • When you program something, most "things" you do are prewritten. These can be on static libraries or dinamic libraries. The difference between these two is that a static library stores "inside" the .exe, while the DLL stores outside. This may give inconvenients at time of avability, but size of all programs is reduced a lot.

[edit] GCC

With GCC on Win32, it is possible to write DLLs in the same way that shared objects are written on POSIX systems. For example, consider two files, testlib.h:

#ifndef _TESTLIB_H
#define _TESTLIB_H

extern int test_func(int a, int b);

#endif

And testlib.c:

#include "testlib.h"

int test_func(int a, int b) {
  return (a + b);
}

Executing GCC (MinGW) with the following options:

gcc -shared -o testlib.dll testlib.c

Will create a file called "testlib.dll". It can then be linked against any file by including the header "testlib.h" and then passing -L. -ltestlib. I don't know about dynamic loading, but this works for shared linking just fine.—Kbolino 01:55, 15 May 2007 (UTC)

[edit] Drawback

Is the info about the drawback called "DLL Hell" needed here?

[edit] Programming examples

Reading this section of the article, it seems more like a tutorial on how to create DLL's rather than an explanation of what they are specifically. Isn't this generally not encouraged? --Gafaddict (talk) 17:56, 21 February 2008 (UTC)