Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

What kind of exception does CWDIO throw?

class CMyDialog
{
public:
CWDIO m_DIO;
};

void CMyDialog::DoSomething(unsigned char nVal)
{
COleVariant v = nVal;

try
{
m_DIO.SingleWrite(v);
}
catch (???)
{
// exception handler
}
}

What kind of exception is being thrown here? I know I'm getting something, because a catch (...) handler gets called. But I can't seem to find the right class.

Thanks in advance for your help.
0 Kudos
Message 1 of 3
(3,329 Views)
CWDIO is an ActiveX control, so most of its exceptions are COleException type. Of course, it is possible that it could be a general error like an Access Violation, which would be just a CException type.

I would be checking for COleException and CException.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 3
(3,329 Views)
I managed to defeat the problem I was having, but I should mention that neither one of those exception type handlers got called. Of course, CException - as the base class - should by all rights have caught any of them.

The try/catch was this:

COleVariant v = /* unsigned char */;

try {
m_DIO.SingleWrite(v);
}
catch (COleException* pE) {
/* handle */
}
catch (COleDispatchException* pE) {
/* handle */
}
catch (CException* pE) {
/* handle */
}
catch (...) {
/* handle */
}

The catch(...) block always got called.
0 Kudos
Message 3 of 3
(3,329 Views)