From: Tim B. <tbi...@us...> - 2006-07-25 23:07:02
|
Update of /cvsroot/aaf/AAF/ref-impl/src/com-api In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv19050/ref-impl/src/com-api Modified Files: CAAFModule.cpp Log Message: Add AAFSetDiagnosticOutput() and IAAFDiagnosticOutput to support diagnostic output from the library to a client implemented destination. Index: CAAFModule.cpp =================================================================== RCS file: /cvsroot/aaf/AAF/ref-impl/src/com-api/CAAFModule.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CAAFModule.cpp 7 Jul 2006 15:16:37 -0000 1.19 --- CAAFModule.cpp 25 Jul 2006 23:06:42 -0000 1.20 *************** *** 1326,1329 **** --- 1326,1372 ---- + STDAPI + AAFSetDiagnosticOutput (IAAFDiagnosticOutput* pOutput) + { + HRESULT hr; + + + try + { + hr = ImplAAFSetDiagnosticOutput + (pOutput); + } + catch (OMException& e) + { + // OMExceptions should be handled by the impl code. However, if an + // unhandled OMException occurs, control reaches here. We must not + // allow the unhandled exception to reach the client code, so we + // turn it into a failure status code. + // + // If the OMException contains an HRESULT, it is returned to the + // client, if not, AAFRESULT_UHANDLED_EXCEPTION is returned. + // + hr = OMExceptionToResult(e, AAFRESULT_UNHANDLED_EXCEPTION); + } + catch (OMAssertionViolation &) + { + // Control reaches here if there is a programming error in the + // impl code that was detected by an assertion violation. + // We must not allow the assertion to reach the client code so + // here we turn it into a failure status code. + // + hr = AAFRESULT_ASSERTION_VIOLATION; + } + catch (...) + { + // We CANNOT throw an exception out of a COM interface method! + // Return a reasonable exception code. + // + hr = AAFRESULT_UNEXPECTED_EXCEPTION; + } + + return hr; + } + STDAPI |