try
{
// call to Com Method
}
catch (COMException e)
{
if (e.ErrorCode == 0x80040154) // REGDB_E_CLASSNOTREG.
{
// handle this error.
}
}
我想检查com例外是否由于REGDB_E_CLASSNOTREG
而引发,然后处理它。我试着用上面的代码,但它给出了警告:如何检查REGDB_E_CLASSNOTREG的ErrorCode?
Comparison to integral constant is useless; the constant is outside the range of type 'int'
我相信这个错误是由于0x80040154
不在的Int32范围。
你能提出任何可能的解决方案吗?或者有没有其他的方法来检查这个?