首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

在组件中怎么抛出这个错误 _com_error

2012-01-24 
在组件中如何抛出这个异常 _com_error?在使用组件时可以通过try{}catch(_com_errore){}来捕获异常。想知道,

在组件中如何抛出这个异常 _com_error?
在使用组件时可以通过
try{
}catch(_com_error   e){
}
来捕获异常。

想知道,在组件中如何抛出这个异常   _com_error?


[解决办法]
搜索 IErrorInfo 接口
[解决办法]
组件:
To return error information
1 Implement the ISupportErrorInfo interface.
2 To create an instance of the generic error object, call the CreateErrorInfo function.
3 To set its contents, use the ICreateErrorInfo methods.
4 To associate the error object with the current logical thread, call the SetErrorInfo function.

客户端:
_com_error类会自动获取错误,看看这个类的源代码。

热点排行