外部 DLL 应该位于哪里?
假设我在模块的顶部有这个:
Public Declare Function getCustomerDetails Lib "CustomerFunctions" () As Long
如果我从 VB6 IDE 运行程序,CustomerFunctions.dll
应该位于哪里?
如果我正在运行程序可执行文件,CustomerFunctions.dll
应该位于哪里?
Let's say I have this at the top of a module:
Public Declare Function getCustomerDetails Lib "CustomerFunctions" () As Long
If I am running the program from the VB6 IDE, where should CustomerFunctions.dll
be located?
If I am running the program executable, where should CustomerFunctions.dll
be located?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当加载标准 DLL(而不是 ActiveX 或 COM DLL)时,Windows 应用以下规则:
如果 SafeDllSearchMode 打开:
如果禁用 SafeDllSearchMode,则搜索顺序如下:
我个人的偏好(而不是乱扔系统或 Windows 目录)是在某处创建developmentDLLs 目录并将其添加到 PATH 变量。分发应用程序时,将 DLL 放置在程序的 App 目录中。这样你干扰其他 DLL 的机会就最小了。有关加载 DLL 的完整信息,请参阅 MSDN。
When loading a standard DLL (rather than an ActiveX or COM dll), Windows applies the following rules;
If SafeDllSearchMode is turned on:
If SafeDllSearchMode is disabled, the search order is as follows:
My personal preference (rather than litter the System or Windows directory) is to create a developmentDLLs directory somewhere and add it to the PATH variable. When distributing the application place the DLL in the program's App directory. This way you have the least chance of interferring with other DLL's. For complete information on the loading of the DLL's see the MSDN.
由于这不是 ActiveX DLL,因此适用的规则略有不同。
c:\windows\system32
中或 VB6 运行的目录中(例如c:\program files\microsoft Visual Studio... )。
c:\windows\system32
或应用程序目录中。请记住,我给了您一个技术答案(例如,将文件放入
c:\windows\system32
),这将起作用。然而,过去十年的趋势是将必要的组件隔离到应用程序目录中。Since this is not an ActiveX DLL, somewhat different rules apply.
c:\windows\system32
or in the directory from which VB6 is running (e.g.c:\program files\microsoft visual studio...
).c:\windows\system32
or the application directory.Keep in mind that I gave you a technical answer (e.g. placing the file into
c:\windows\system32
), which will work. However, the trend in the last decade has been to isolate the necessary components into the application directory.