错误“无法使用与其基础RCW分离的COM对象".设定进度时 [英] Error "COM object that has been separated from its underlying RCW cannot be used" when set the progress
本文介绍了错误“无法使用与其基础RCW分离的COM对象".设定进度时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我通过委托事件在进度条上设置进度时,抛出上述错误.
When I set the progress on a progress bar through a delegate event, throws the above error.
private void UpdateProgress(string strIn, string strType, int iBlockCount)
{
if (this.txtOutEvent.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(UpdateProgress);
this.BeginInvoke(d, new object[] { strIn, strType, iBlockCount});
}
else
{
EventLogger(strIn);
this.progressBarUpdate.Value = iBlockCount;
}
}
有什么主意吗?
any idea?
推荐答案
最后,我自己找到了解决方案.由于错误,我在关闭表单时没有处理掉某些对象.现在可以了.
Finally I found the solution by myself. By mistake I didn''t dispose some of the objects when closing the form. Now it''s fine.
这篇关于错误“无法使用与其基础RCW分离的COM对象".设定进度时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文