|
From: Tim B. <tbi...@us...> - 2006-06-08 14:55:22
|
Update of /cvsroot/aaf/AAF/ref-impl/src/com-api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16313/ref-impl/src/com-api Modified Files: CAAFModule.cpp Log Message: Stubbed implementation of AAFResultToText() and AAFResultToTextBufLen(). Index: CAAFModule.cpp =================================================================== RCS file: /cvsroot/aaf/AAF/ref-impl/src/com-api/CAAFModule.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CAAFModule.cpp 7 Jun 2006 16:07:30 -0000 1.17 --- CAAFModule.cpp 8 Jun 2006 14:55:14 -0000 1.18 *************** *** 1505,1506 **** --- 1505,1601 ---- + STDAPI + AAFResultToTextBufLen (AAFRESULT result, + aafUInt32 * pResultTextSize) + { + HRESULT hr; + + + try + { + hr = ImplAAFResultToTextBufLen + (result, + pResultTextSize); + } + 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_UNEXPECTED_EXCEPTION is returned. + // + hr = OMExceptionToResult(e, AAFRESULT_UNEXPECTED_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 + AAFResultToText (AAFRESULT result, + aafCharacter * pResultText, + aafUInt32 resultTextSize) + { + HRESULT hr; + + + try + { + hr = ImplAAFResultToText + (result, + pResultText, + resultTextSize); + } + 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_UNEXPECTED_EXCEPTION is returned. + // + hr = OMExceptionToResult(e, AAFRESULT_UNEXPECTED_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; + } + + |