可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
In the Windows world, what is the correct name for a good. old-fashioned C++ DLL with exported functions? Not a COM DLL, not a .NET DLL. The kind of DLL that we used to invoke by calling LoadLibrary() and GetProcAddress()?
I've always called them "flat DLLs" because the caller cannot instantiate objects from the DLL, but what is the correct name?
EDIT
Thanks for the answers.
Just "DLL" may be technically correct, but where I work everyone assumes that "DLL" means COM, or maybe at a push .NET, so I need a term that distinguishes exactly what I mean.
回答1:
"Native" is probably the most common term, though "windows" or "console" are more technically correct, since these are the subsystems likely to be used (the "native" subsystem is something different). I have also heard "C DLL" used, implying the same as your use of "flat DLL".
A dynamic link library is a generic concept - a "Windows dynamic link library" is differentiated from *nix's equivalent, and also from managed libraries.
COM is little more than an encapsulation convention in this context - Windows DLLs can contain COM servers, as can portable executable (PE) files.
回答2:
A .dll? All those other things use the basic functionality provided by a .dll to do their respective thing. Maybe a raw .dll if you want to be pedantic, but .dll should be fine.
回答3:
There is no "correct" name anymore that there is a "correct" name for "plain car". (I do use "plain DLLs".
COM DLLs, OCXs, .NET DLLs,... they are all DLLs, with additional features on them. Nothing prevents you from, say, having a DLL that can be accessed both via COM or manual LoadLibrary/GetProcAdress. I've seen it. You can even expose the same object via a "plain" non-objectized API.
回答4:
I'm with Charles Graham. They're just DLLs. Nothing more, nothing less.
Some DLLs expose APIs that allow them to be used with certain programming patterns (for example, DLLs that expose DllGetClassObject and DllCanUnloadNow can be used to host COM objects (but there are other ways COM objects can be hosted)).
回答5:
May be 'A Regular DLL'. This is the term that we use but 'DLL' works as well.
回答6:
It's a "dynamic link library". Sometimes referred to as a "dynalink library". As opposed to a "static link library", where you choose your own poison. Instead you take the poison du jour, as randomly installed by the user somewhere on the execution path.
回答7:
I always just called them DLLs, but I didn't stay in th C++/VB6 world for too long.
回答8:
I agree that there is a need for terminology to describe a DLL that cannot be executed as managed code (in other words requires interop for use by managed code) and that cannot be used as a COM object. Many times developers just say DLL and that is ambiguous. Yes, it is totally valid to call a .Net Class library a DLL and to call a COM in-process server a DLL but for the purpose of communicating it is ambiguous to just say DLL.
See my article Native Windows Dynamic Link Libraries (DLLs) for more.