Hello
If you are using the CNi classes, you should be able to catch the exceptions using the CNiException class.
But you wont be able to do that if you are using the
CWDAQ controls with the Class Wizard generated wrappers, since these are auto generated wrappers. You should be able to catch the exceptions by using the CException class, like so
try{
m_AIPoint.SetDevice(5); //Invalid device number
m_AIPoint.GetChannels().RemoveAll();
m_AIPoint.GetChannels().Add(m_Edit, vOptional, vOptional, vOptional, vOptional);
m_AIPoint.SingleRead(&Voltage, vOptional);
m_Meter.SetValue(Voltage);
m_NumEdit.SetValue(Voltage);
}
catch(CException *e)
{
e->ReportError();
e->Delete();
}
Check the MSDN Help for the properties and methods of the
CException class for more information.
I hope this helps
Bilal Durrani
NI
Bilal Durrani
NI