由于共享内存,当 MS Visual C 6.0 DLL 崩溃时,也会导致 VB 6 EXE 崩溃
我有一个问题,由于共享内存,当 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它与 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.