简体   繁体   English

VB6-C / C ++ dll运行时错误48

[英]VB6 - runtime error 48 with C/C++ dll

First of all I want to say that I read most of the other questions here with similar issues before posting this question. 首先,我想说的是,在发布此问题之前,我在这里阅读了其他大多数类似问题。 But my situation is slightly different. 但是我的情况略有不同。

I have an old VB6 application which uses a custom C/C++ dll to send/read data over TCP. 我有一个旧的VB6应用程序,它使用自定义C / C ++ dll通过TCP发送/读取数据。

The app is on a shared network drive of a win2003 server which multiple users can access. 该应用程序位于Win2003服务器的共享网络驱动器上,多个用户可以访问。 The dll sits in the application path and I use declare to load it. dll位于应用程序路径中,我使用声明来加载它。

VB6: VB6:

Public Declare Function Interface_Open Lib "Interface.dll" Alias "Open" As Integer

C/C++ dll: C / C ++ dll:

_declspec(dllexport) int _stdcall Open() { }

Now for the strange part: The application runs smoothly for 90% of the time. 现在,奇怪的是:应用程序可以在90%的时间内平稳运行。 But some users experience random the runtime error 48 "dll not found" while others dont. 但是某些用户会随机遇到运行时错误48“未找到dll”,而其他用户则没有。

It seems to fail when I try to call the dll: 当我尝试调用dll时似乎失败了:

Interface_Open

Im not able to replicate the error on my win7 64bit machine thats what confuses me. 我无法在我的win7 64位计算机上复制错误,这使我感到困惑。 I also checked the network permissions for the users on the share but they were fine. 我还检查了共享中用户的网络权限,但是他们很好。

I don't think the problem lies inside the C/C++ code because logs tell me it failes before entering the dll. 我认为问题不在于C / C ++代码内,因为日志告诉我它在进入dll之前失败。

Should I return a long value instead of an integer? 我应该返回长值而不是整数吗? Could this be a reason why it fails to load the dll? 这可能是它无法加载dll的原因吗?

Integers are 16 bit in VB, for compatability with 16 bit VB. VB中的整数是16位,以便与16位VB兼容。 So an integer in any other language is called a long in VB. 因此,任何其他语言中的整数在VB中称为long。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM