Exception mechanism, Extras, 23 extras – Sundance SMT6025 v.2.9 User Manual
Page 41

Version 2.9
Page 41 of 45
SMT6025 User Manual
// Open the library
SMTRet ret = SmtOpen();
if ( ret!=SMT_OK )
{
cout << "Could not open SmtDrv library. The error was ("
<< SmtGetError(ret)
<< ")"
<< endl;
return 0;
}
22.2 Exception mechanism
The functions accessed through the SmtOpenBoard() interface will signal errors
by throwing an exception of type SMTExc. Any of the functions provided by
IFHw may throw an exception of type SMTExc.
You need to surround your function accesses by a try-catch block as shown:
try
{
pB->ResetTIMs();
pB->BinaryLoad( "..\\DSP\\Dsp335.app" );
}
catch( SMTExc &e )
{
cout << "An exception occured. ("
<< e.GetError()
<< ")"
<< endl;
}
Your program will be terminated with an un-handled exception dialog should
you fail to catch the exception.
23 Extras
A separate DLL (SmtUI.dll) supplies common user interface functionality. This
DLL contains the most often used, general-purpose dialogs and can make life
easier for developers.
To use SmtUI.dll you need to include SmtUI.h in your source and then link to
SmtUI.lib. See the sample for more detail.
To obtain an interface to the SmtUI DLL, you call Smt_UIOpen().
User Manual (QCF42); Version 2.9, 22/02/02; © Sundance Multiprocessor Technology Ltd. 2002