代码以释放正在使用的RCW [英] code to free the RCW which is in use

查看:97
本文介绍了代码以释放正在使用的RCW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在C#应用程序中运行线程.但是,如果在关闭应用程序时没有终止线程,则会引发一个错误,称为尝试释放正在使用的RCW".有谁可以帮助我解决这个问题?

Am running a thread in my C# application. But with out aborting the thread if am closing the application it is raising an error called "attempt to free the RCW which is in use". Will any body help me to solve this problem

推荐答案

如何在不中断线程的情况下关闭应用程序?实际上,您可以这样做,因为该线程是从线程池中获取的,否则,您应该中止或退出您创建的线程.

您观察到的错误与运行时可调用包装程序(RCW)有关,请参见 http://en.wikipedia.org/wiki/Runtime_Callable_Wrapper [ ^ ])用于COM访问.您可以在此CodeProject文章中找到此概述: .NET-COM互操作性 [ ^ ].

如果在调查案件时需要进一步的帮助,则需要提供一些与您使用的COM组件或服务器相关的代码.您所观察到的情况似乎很少见;即使其原因很明显,我也没有引用此错误消息.

—SA
How can you close the application without aborting the thread? You actually could do ut, it the thread is taken from the thread pool, otherwise you should abort or otherwise exit the thread you have created.

The error you observe it related to the Runtime Callable Wrapper (RCW, see http://en.wikipedia.org/wiki/Runtime_Callable_Wrapper[^]) use for COM access. You can find the overview of this in this CodeProject article: .NET - COM Interoperability[^].

If you need further help in investigation of your case, you need to provide some relevant code related to COM component or server you use. It looks like the condition you observe is rare; I did not references to this error message, even though its reason is basically clear.

—SA


这篇关于代码以释放正在使用的RCW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆