在C#中调用COM对象,此COM对象有两个事件,如果对两个事件赋值时,第二个就会出异常,对换位置也是第二个出异常,如果只对一下赋则正常。请问这是为什么呢?COM对象是用Delphi写的,在Delphi中都能正常调用。就是下面两句,就是第二句是总出异常。
p.Progress += new IMyObjEvents_ProgressEventHandler(OnProgressFired);
p.Complete += new IMyObjEvents_CompleteEventHandler(OnCompleteFired);
p.Progress += new IMyObjEvents_ProgressEventHandler(OnProgressFired);
p.Complete += new IMyObjEvents_CompleteEventHandler(OnCompleteFired);
解决方案 »
- c# 调用摄像头,只能调用一次,第二次调用就不好使了
- aspx如何调用用户控件ascx
- [★]WinForm中,主线程如何优雅的控制子线程?
- 请正则大人帮忙写个正则表达式
- 怎样让自定义控件中的TextBox在设计模式中可以接受输入和选取其文本内容
- 100分求助:第二个线程不能进入
- 问个小问题
- C#中这样引入activex控件啊?
- ?info_hash=%b4%15T%9b%86q%24%88%19H%c6%c7%8d%9d%90%be%a8d%a1%b1 怎么转为 b415549b867124881948c6c78d9d90bea864a1b1 100分!!!急!!!!!!
- dataGrid1用数据集作数据源可以添加,删除,不能修改,为什么?
- vs2005 新建web server 急!
- 怎样建立.net2003与sqlserver6.5数据库的连接(在线等)
private int m_Cookie;
private PowerPoint.ApplicationClass oPPT;
private void button1_Click(object sender, System.EventArgs e)
{
// QI for IConnectionPointContainer.
UCOMIConnectionPointContainer oConnPointContainer = (UCOMIConnectionPointContainer) oPPT;
// Get the GUID of the EApplication interface.
Guid guid=typeof(PowerPoint.EApplication).GUID; // Find the connection point.
oConnPointContainer.FindConnectionPoint(ref guid,out m_oConnectionPoint);
// Call Advise to sink up the connection.
m_oConnectionPoint.Advise(this,out m_Cookie);
}