VB6 - 找不到 DLL
我正在尝试使用命令
Private Declare Function myFuncLib "myDLL.dll" (ByVal file_name_in As String, _ ByVal file_name_out As String) As Long
但是当我运行程序时,它会弹出一个带有文本的框“:“运行时错误:53找不到:myDLL.dll”
DLL被放置在相同的位置 如果我将 myDLL.dll 放在 system32 文件夹
中,它可以工作,但我不想这样做,我想将 dll 放在项目的同一文件夹中,
有没有办法解决这个问题 ?
。有问题吗
I'm trying to load a DLL in VB6 using the command
Private Declare Function myFuncLib "myDLL.dll" (ByVal file_name_in As String, _
ByVal file_name_out As String) As Long
But as soon as I run the program it pop-up a box with the text": "Run time error: 53 Cannot find: myDLL.dll"
The DLL is placed in the same directory of the project.
If I put myDLL.dll in the system32 folder it works, but I don't want to do it, I would like to place the dll in the same folder of the project.
Is there a way to solve this problem?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我的通灵能力预测您正在从 VB6 IDE 运行 - 因为构建的 EXE会在应用程序目录(与 exe 相同的目录)中找到 DLL。
Chdrive App.Path: Chdir App.Path
(空中代码)C:\Program Files\Microsoft Visual Studio\VB98\
您。可以将 DLL 与您构建的 EXE 放在用户计算机/生产计算机上。My psychic powers predict you are running from the VB6 IDE - because a built EXE would find DLLs in the app directory (the same directory as the exe).
Chdrive App.Path: Chdir App.Path
(air code)C:\Program Files\Microsoft Visual Studio\VB98\
You can put the DLL with your built EXE on the user machines / production machines.声明对Kernel32.lib SetDllDirectory函数的引用:
然后设置Dll目录如下:
Declare a reference to Kernel32.lib SetDllDirectory function:
Then set the Dll directory as follows:
使用“Depends”解决
DLL 中存在未满足的依赖关系,但显然它在第一个 DLL 入口点返回错误。
谢谢大家
Solved using "Depends"
There was an unsatisfied dependency in the DLL, but obviously it was returning the error on the first DLL entry point.
Thank you all
正如 Beppe 在 他们的答案中所说,
如果您看到其他 DLLS 带有 ?他们的名字旁边意味着他们失踪了。
通常它是 Microsoft C++ 调试 dll 之一,即 MSVCR120D.DLL
As Beppe said in their answer, use
If you seel other DLLS with ? next to their name it means they are missing.
Usually it will be one of the Microsoft C++ Debug dll i.e MSVCR120D.DLL
你需要先注册你的DLL..
”是DLL的路径。如果DLL放在同一目录下,那么可以设置:
You need to register your DLL first..
Where "path" is the path of the DLL.. If the DLL is placed in the same directory, then you can set: