???? ID: 815065 - ????? ???????: 30 ??????? 2010 - ??????: 4.0 ???? ??? DLL ???
?? ????? ?????????? ???? ????? ???? ?? ?? ???? ???????? ???? ????????? (DLL) ?? ?? ??????? ?????? ?? ?? ?? ?? ???? ?? ?? ?? DLL ?? ????? ????? ???? ???, ?? ???? ????? ?? ?? ??? ????? ?????? ?? ?? ?? ?? ?? ???? DLL ?? ?????? ???? ?? ????? ???? ?????? ??? ??? DLL ???? ???? ????? ???? ???? ??, ?? ???? ????? ?? ?? ???????? ???? ???????, DLL ??????????, DLL ????????? ?? ?? ????? ???? ??, DLL ??? ?????? ?? ????? ?????? ?????? DLL ?? ??????? ????? ?? ???? ?? Microsoft .NET Framework assemblies DLL ?? ??? high-level ????? ?? ??? ???? ?? ???? ??? ?????Microsoft Windows ???????? ???????? ??? ?? "?? ?? ????" ??? ??? ???????? ???, ?? ??? ?????? ???????? ?????? ?? ??????????? ???????? ???? ????????? (DLL) ?????? ?????? ???? ??? ??? ??, ?? ?? ?? Windows ???????? ???????? ??? ?? ?? ?? ???? ????????? ?? ????? ???, ??????? ????????? ?? ??????????? ?? ???? ?? ?????? ?????? ??? ?? DLL. ?????? ?? ???, ??? ??????????? ??? ?? ???? ??????? ?? ???? ???, ?? ????????? ?? ???????? ??????? ??? ?? ?? DLL ??? ?????? ???? ???? ??? DLL ?? ????? ???, ??? reuse, ???? ?????? ????? ?? ??? modularization ?????? ???? ??? ??? ???? ??, ?? ????? ????? ?? ??? ?????, ???????? ?????? ?? ????????? ???? ?? ???, ???? ?? ????? ?? ?? ????? ????? ?? ???????? ?? ?? ????? ?? ??? ????????? ??? DLL ?? ????? ???? ??, ???????? ??? ???? ?? ?? ??? ?????? ????????? ?? ????? ?? ??? ???? ?? ???? ?? ???? ??? ?? ??? ????????? ??? DLL ?? ????? ???? ??, ?? ???????? ?? ???? ??? ??? ???? ???? ????????? ???????? ?? ???? ?? ?? ?? ???????? ?????, ??? ????????? ???? ??????????? ?? ???? ???? Microsoft .NET Framework ?? ????? ?? ??? ??????? ???????? ???????? assemblies ?? ????? ???? eliminated ???? ??? ??? ???? ??????????? ??? DLL ?????? DLL ??? ?? ????????? ?? ?????? ??? ?? ???? ?? ?? ?? ??? ??? ?? ?? ???? ????????? ?????? ????? ???? ?? ???? ??? ???? ?????? ?? ???, Windows ???????? ???????? ??? Comdlg32 DLL ?? ??????? ????? ????? ?? ?????? ?? ??????? ??? ?????, ???????? ????????? ??????????? ?? ??????????? ???? ?? ??? ?? DLL ??? ????? ?? ?? ????? ?? ???? ??? ????????????? ????? ?? ??????? ?? ??? ?? .. ?? ??? reuse ?? ???? ?????? ????? ??? ?????? ???? ????? ????? ???? ??? DLL, ???? ????????? ??? ??? ??? modularized ?? ???? ???? ?????? ?? ???, ??????? ?????? ???? ????????? ???? ???????? ???? ?? ???? ??? ???????? ??????? ???? ??? ???? ?? ???? ??? ????? ????????? ????? ??? ??? ?? ??????? ??????? ???? ??? ??? ??????? ??? ???, ??????? ????????? ?? ??? ??? ???? ?? ??, ?? ???? ??????? ??? ???? ?? ?? ?? ??????????? ?? ?????? ???? ??? ??? ??, ?????? ????????? ?? ???? ????? ?? ???????? ??? ???? ???????? ??????? ?? ???? ???? ?? ??? ???? ??? ??? ???? ?????? ?? ???, ???? ???? payroll ????????? ?? ???? ??, ?? ???????? ???? ?? ?? ????????? ????? ?? ???????? ???? ?? ??? ??? DLL ??? ???, ?? ?? ?? ????? ?? ???? ????????? ?? ???: ??????? ???? ?? ??? ???? ???? ?????? ???? ?? ???? ???? ????? ???? ??? Windows ???????? ???????? ??? DLL ?? ??? ??? ???? ???? ??? ?? ??????? ?? ????? ???? ??:
DLL ?? ???????? ???? ??? ?? ??? ????????? ??? DLL ?? ????? ???? ??, ?? ?????? ???? ???? ??? ?? ????? ?? ????? ???? ??:
DLL ?????????????? ????????? ?? ??? DLL ?? ??? ???? DLL ??? ??? DLL ??????? ????? ???? ??, ?? ??? ???????? ?? ???? ??? ?????, ????????? self-contained ???? ??, ?? ????????? ???????? ????? ?? ???? ?? ??? ???????? ??? ??? ?????? ?? ???, ????????? ???? ?? ???? ??? ??? ????? ???????? ??? ?? ?? ???? ??:
????? ???? ???????? ???????? ?? ?? ???? ??? ??? ???? ?? ??? ??? ??? Windows ???????? ???????? ??? ?? Microsoft Windows 2000 ??? ???????? ??? ?? ???????? ?? ????? ???? ??:
DLL troubleshooting toolsSeveral tools are available to help you troubleshoot DLL problems. The following tools are some of these tools.Dependency WalkerThe Dependency Walker tool can recursively scan for all dependent DLLs that are used by a program. When you open a program in Dependency Walker, Dependency Walker performs the following checks:
??????\Program Files\Microsoft Visual Studio\Common\Tools DLL Universal Problem SolverThe DLL Universal Problem Solver (DUPS) tool is used to audit, compare, document, and display DLL information. The following list describes the utilities that make up the DUPS tool:
247957
(http://support.microsoft.com/kb/247957/
)
Using DUPS.exe to resolve DLL compatibility problems DLL Help databaseThe DLL Help database helps you locate specific versions of DLLs that are installed by Microsoft software products. For more information about the DLL Help database, visit the following Microsoft Web site:http://support.microsoft.com/dllhelp/
(http://support.microsoft.com/dllhelp/)
DLL developmentThis section describes the issues and the requirements that you should consider when you develop your own DLLs.Types of DLLs?? ?? ???? ????????? ??? ??? DLL ???, ?? ??????? ??? ?? ???? ?? ?????? DLL ?????? ?? ??? ???? ???? ??? ??? ??? ???????? ??????? ?? ??-???? ???????? ??????? ?? ???? ?? ?? ??????? ?????? ??? ??? ???????? ?????? ??? ??? ???????? ????, ??? ?? ????????? ??????? ??????? ???? DLL ????????? ?????? ?? ??? ?????? ??? ???? ?? ??? ?? ??? ??? ???????? ???? ?? ?????, ?????? ????? ??? (.h) ???? ?? ???? ????????? (.lib) ?? ??? ????? ?? ?? ?????? ???? ?? ????????? ????? ?? ?? ?? ???? ???, linker ????? ?????? ?????? ??????? ??? ??? ?????? DLL ??????? ??????? ?? ?? ???? ?? DLL ?? ??? ???? ?? ??? ?????? ????? ??-???? ???????? ?????? ??-???? ???????? ????, ??? ?? ????????? ??? ?? ??LoadLibrary?????? ??LoadLibraryEx????? ????? ??? DLL ?? ??? ???? ?? ??? ??? DLL ??????????? ??? ?? ??, ?? ??? ?? ????? ????GetProcAddress?????? ?? ??? ???? ????? ??? ?? ????????? DLL ??????? ?? ??? ?? ??????? ???? ?? ??? ??? ?? ????? ???? ?? ??-???? ???????? ????, ???? ???? ???? ????????? ???? ???? ??????? ?? ????? ??? ??? ???????? ???? ?? ???? ?? ??? ?? ?? ??-???? ???????? ???? ?? ????? ???? ?? ??? ????? ???? ?? ??? ????????? ?????? ?? ????? ???? ??:
DLL ????????? ??????? ?? ??? DLL ????? ???, ?? ?? ?? ????????? ????? ?????? ???????? ??? ?? ????????? ?? ????? ????????? ????? ?????? ??????????? ?? ??????? ??????? ????? DLL ??? ?? ??? ???? ??, ?? ????? ?? DLL detached ??? ???? ???????? ??????? ???? ?? ??? ?? DLL ?????? ?????? ?? ??? ??? ???? ???????? ?? ???? ???? ?? ??? ?? ????????? ????? ?????? ?? ????? ?? ???? ???? ??? ??, ????????? multithreaded ??, ??? ?? ????? ?? ???? ????? ??????? ?????? (TLS) ??? ????????? ????? ?????? ???????? ????? ?? ??? ???? ?? ?????? ?????? ???? ?? ???? ????? ??? ?? DLL ????????? ????? ?????? ?? ?? ?????? ???????????? ????? ?????? ?? ??????? ????????? ????? ???? ????? ???? ????? ?? ???? ?? ???? DLL ??? ?? ??? ?? ?? ??????? ?????? ??? ???? ???? ?????? ?????? ?? ???, ????????? ????? ?????? ??? ???? ????? ???? ???? ?? indirectly ???LoadLibrary?????? ??LoadLibraryEx?????? ?? ??? ???? ???.. ??? ??, ???? ????? ???? ???FreeLibrary?????? ?? terminating ????????? ??? ???:Multithreaded ???????????, ????????? ???? ?? ?? ?? ????? DLL ?? ??????? ???? ?????????? ???? ??????? ???? ????? ?? ???? ?? ??? (????? ????????)? ??? ???? ?? ???, ???????? ????? ?? ??? ????? ???? ?????? ????? ?? ??? TLS ?? ????? ????? DLL ??????? ?? ??????? ????DLL ??????? ?? ??????? ???? ?? ??? ?? ?? ???? ??? ?? ?? ????????? DLL ??????? ???? ?? ??? ??? ?????? ?????? ?????? ?? ?????? DLL ??????? ?? ???? ???? ???? ?? ?? ??????? ??????? (.def) ????? ????????? ?????? ?????? ?? ????? ????, ?? ????? ?????? ?? ??? ??????? ???? ????? ??? ?? ???????? ????? ????? ???? ????: __declspec(dllexport) ????????? ??? ?????? DLL ?????? ?? ????? ????, ?? ????? ?????? ?? ???? ???? ????? ??? ?? ???????? ?????? ????? ???? ????:__declspec(dllimport) ??????????, ?? ???? ?? ????? ??? ???? ?? ????? ??? ?? ?? ????????????? ??????? ?? ??ifdef??? ??? ??????? ?? ???? ?? ??? ?? ??? ???? ?? ??? ????? ?????? DLL ??????? ?? ????? ???? ?? ??? ???? ??????? ??????? ????? ?? ????? ?? ????? ?? ?? ??? ??????? ??????? ????? ?? ????? ?? ?????? DLL ??????? ???? ?? ??? ?????? ?????? ?????? ???? ?? ???? ??? In the module definition file, you declare theLIBRARYstatement and theEXPORTSstatement for the DLL. The following code is an example of a definition file. Sample DLL and applicationIn Microsoft Visual C++ 6.0, you can create a DLL by selecting either theWin32 Dynamic-Link Libraryproject type or theMFC AppWizard (dll)project type.The following code is an example of a DLL that was created in Visual C++ by using theWin32 Dynamic-Link Libraryproject type. In run-time dynamic linking, you use code that is similar to the following code to call the SampleDLL.dll exported DLL function.
The .NET Framework assemblyWith the introduction of Microsoft .NET and the .NET Framework, most of the problems that are associated with DLLs have been eliminated by using assemblies. An assembly is a logical unit of functionality that runs under the control of the .NET common language runtime (CLR). An assembly physically exists as a .dll file or as an .exe file. However, internally an assembly is very different from a Microsoft Win32 DLL.An assembly file contains an assembly manifest, type metadata, Microsoft intermediate language (MSIL) code, and other resources. The assembly manifest contains the assembly metadata that provides all the information that is required for an assembly to be self-describing. The following information is included in the assembly manifest:
The following list describes some of the features of assemblies compared to the features of Win32 DLLs:
??????DLL ?? .NET Framework ?? ???? ??? ???? ??????? ?? ??? assemblies, ?? ????? Microsoft ??? ???? ?? ????: DLL ????? HTTP://msdn2.Microsoft.com/en-us/library/ms811694.aspx (http://msdn2.microsoft.com/en-us/library/ms811694.aspx) ???-??? ???? ????????? ??? ??? ?? ??????????? HTTP://msdn2.Microsoft.com/en-us/library/ms811700.aspx (http://msdn2.microsoft.com/en-us/library/ms811700.aspx) ??????????? ?? Windows XP ?? ??? ???-??? assemblies ???? ????? ?? ???? isolated HTTP://msdn2.Microsoft.com/en-us/library/ms997620.aspx (http://msdn2.microsoft.com/en-us/library/ms997620.aspx) ??????? simplifying ?? .NET Framework ?? ??? DLL ????? ?? ?? ???? HTTP://msdn2.Microsoft.com/en-us/netframework/aa497268.aspx (http://msdn2.microsoft.com/en-us/netframework/aa497268.aspx) .NET Framework ?????? ????????????: Assemblies (vs.71) http://msdn2.Microsoft.com/en-us/library/hk5f40ct .aspx (http://msdn2.microsoft.com/en-us/library/hk5f40ct(vs.71).aspx) ?? ??-???? ???????? ???? HTTP://msdn2.Microsoft.com/en-us/library/ms685090.aspx (http://msdn2.microsoft.com/en-us/library/ms685090.aspx) ??????? ?????? ????? HTTP://msdn2.Microsoft.com/en-us/library/ms686749.aspx (http://msdn2.microsoft.com/en-us/library/ms686749.aspx) ???? ???? ???? ??:
???? ?????? ??????????????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??. ?????????? ?? ??????? ????????? ??????? ??:815065
(http://support.microsoft.com/kb/815065/en-us/
)
| ???? ?????? ???? ?????? ??????
????????? ?????? ??????? ???????? ??????
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email

????? ?? ???? ????
