由于共享内存,当 MS Visual C 6.0 DLL 崩溃时,也会导致 VB 6 EXE 崩溃

发布于 2024-08-23 20:15:16 字数 249 浏览 10 评论 0原文

我有一个问题,由于共享内存,当 MS Visual C 6.0 DLL 崩溃时,它也会导致 VB 6 EXE 崩溃。 我们的主程序 EXE 是用 VB 6 编写的。它调用各种文件类型的插件(DLL),这些插件是用 MS Visual C 6.0 编写的。当“C”插件(DLL)遇到问题时,它有时会崩溃,这会导致 EXE 程序也崩溃,因为它们共享相同的地址空间。 因此,我正在寻找一种方法,当 DLL 崩溃时,防止 MS Visual C 6.0 DLL 导致 VB 6 EXE 崩溃。

I have a problem where Due to Shared memory, when MS Visual C 6.0 DLL crashes it also causes VB 6 EXE to crash.
Our main program EXE is written in VB 6. It calls plug-ins (DLL's) for the various file types, these are written in MS Visual C 6.0. When a "C" plug-in (DLL) encounters a problem it some times crashes and this causes the EXE program to also crash as they share the same address space.
So, I am looking for a way the prevent the MS Visual C 6.0 DLL's from causing the VB 6 EXE from also crashing, when the DLL crashes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

玩套路吗 2024-08-30 20:15:16

它与 DLL 和 EXE 无关。这是一个崩溃的线程。如果您没有捕获异常,那么将调用 Windows 中的默认异常处理程序。这将终止该进程,并可选择向 Microsoft 告知该问题。

在 VB6 中不可能捕获和处理像 AccessViolation 这样的异常。无论如何,这不值得麻烦,您的主执行线程已经遭受了心脏病,并且无法以有意义的方式继续。即使你能抓住它,该程序也处于非常糟糕的状态,其全局状态已部分变异。尝试继续只会造成更多崩溃。或者更糟糕的是,生成无效结果并破坏有价值的数据。

一种选择是在单独的进程中运行 DLL。崩溃将终止该进程,而不是您的进程。做到这一点非常困难,很难检测到崩溃。而且进程互操作很棘手。

It has nothing to do with DLLs vs EXEs. It is a thread that crashes. If you don't catch the exception then that will invoke the default exception handler in Windows. Which will terminate the process, optionally telling Microsoft about the problem.

Catching and handling exceptions like AccessViolation is not possible in VB6. It isn't worth the trouble anyway, your main execution thread has suffered a heart attack and cannot continue in a meaningful way. Even if you could catch it, the program is in a very poor state with its global state partially mutated. Trying to continue will just create more crashes. Or much worse, generate invalid results and destroy valuable data.

One option is to run the DLL in a separate process. A crash will terminate that process, not yours. Getting this right is very difficult, it is hard to detect the crash. And the process interop is tricky.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文