问题描述
COM控件是用C ++实现的.它引发了几个事件.一些在主线程中引发,而另一些在单独的线程中引发. The COM control is implemented in C++. It raises several events. Some are raised in the main thread and some in a separate thread. 在以下情况下可以正常工作: This works fine in the following cases: -一个独立的C#客户端接收事件. - A standalone C# client receives the events. -在VB6 IDE中运行的VB6客户端接收事件. - A VB6 client run from within the VB6 IDE receives the events. -同一VB6客户端独立运行,从COM控件主线程接收事件. - Same VB6 client run standalone, receives events from the COM control main thread. 但是,当VB6独立客户端必须处理从COM控件辅助线程引发的事件时,它崩溃: However the VB6 standalone client crashes when it must handle an event raised from the COM control secondary thread: -msvbvm60dll崩溃,错误0xc0000005(访问冲突). - msvbvm60dll crashes with error 0xc0000005 (access violation). 大约6个月前,我最后一次独立运行VB6客户端时,一切运行良好.另外,如上所述,COM控件仍然可以在C#客户端上正常运行,并且VB6客户端可以在VB6 IDE中运行. When I last ran the VB6 client standalone some 6 months ago, all worked well. Also, as stated above, the COM control still works OK with a C# client, and a VB6 client run from within the VB6 IDE. 我已经尝试了以下方法: I have already tried the following: -将VB6更新为SP6 - Updated VB6 to SP6 -将VB6运行时更新为SP6 - Updated the VB6 runtime to SP6 -在COM控件中尝试了不同的线程模型(空闲,单元,单线程等) - Tried different threading models in the COM control (free, apartment, single etc.) 6个月前,我的计算机设置中唯一发生变化的是Windows更新(自动).这可能是根本原因,但很难追踪. The only thing that has changed in my computer setup from 6 months ago are Windows updates (automatically). That could be a possible root cause, but difficult to track down. 否则,我找不到独立的VB客户端突然无法处理以前正常运行的COM控件事件的原因. Otherwise I can't find the reason why the a standalone VB client suddenly fails to handle events from a COM control where it used to be working fine. 任何帮助将不胜感激. 此致 马丁·史密斯 其他VB论坛(如数据"和设置")未涵盖的问题和讨论. (不适用于VB6问题.) Questions and discussions not covered in the other VB forums such as Data and Setup. (Not for VB6 questions.) 这篇关于当COM控件引发线程中的事件时,VB6独立客户端崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!推荐答案