dlls: an overview
a dynamic-link library (dll) is an executable file that acts as a shared library of functions. dynamic linking provides a way for a process to call a function that is not part of its executable code. the executable code for the function is located in a dll, which contains one or more functions that are compiled, linked, and stored separately from the processes that use them. dlls also facilitate the sharing of data and resources. multiple applications can simultaneously access the contents of a single copy of a dll in memory. this code can be called from a powerbuilder program even though it is written in another language such as c/c++, pascal or in any other language that supports the pascal, winapi macro calling sequence for 16-bit and the standard calling sequence for 32-bit.
dynamic linking differs from static linking in that it allows an executable module (either a .dll or .exe file) to include only the information needed at run time to locate the executable code for a dll function. in static linking, the linker gets all the referenced functions from the static link library and places it with your code into your executable. using dlls instead of static link libraries makes the size of the executable file smaller. if several applications use the same dll, this can be a big savings in disk space and memory.
a .dll file has a layout very similar to an .exe file, with one important difference - a dll file contains an exports table. the exports table contains the name of every function that the dll exports to other executables. these functions are the entry points into the dll; only the functions in the exports table can be accessed by other executables. any other functions in the dll are private to the dll.
you can export functions from a dll with two methods:
1) create a module definition (.def) file and use the .def file when building the dll.
2) use the keyword __declspec(dllexport) in the function's definition. when exporting functions with either method, make sure to use the __stdcall calling convention.
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器