用如下代码把你的代码包起来
try 

    //你的代码 

catch(_com_error &e) 

    AfxMessageBox(e.Description()); 

看看能否捕获异常??