Logo Search packages:      
Sourcecode: xulrunner version File versions  Download package

static HRESULT Error ( HRESULT  hResult,
const CComBSTR &  message 
) [static]

Sets the COM error from a result code and text message. This is the base implementation for subsequent string based overrides

Parameters:
hResult the COM error code to be used
message the message to put in the error
Returns:
the error code passed in via hResult

Definition at line 51 of file XPCDispTearOff.cpp.

Referenced by com::netscape::javascript::qa::drivers::RhinoEnv::createContext(), Error(), XPCDispatchTearOff::Invoke(), and SetCOMError().

{
    CComPtr<ICreateErrorInfo> pCreateError;
    CComPtr<IErrorInfo> pError;
    HRESULT result = CreateErrorInfo(&pCreateError);
    if(FAILED(result))
        return E_NOTIMPL;
    result = pCreateError->QueryInterface(&pError);
    if(FAILED(result))
        return E_NOTIMPL;
    result = pCreateError->SetDescription(message);
    if(FAILED(result))
        return E_NOTIMPL;
    result = pCreateError->SetGUID(IID_IDispatch);
    if(FAILED(result))
        return E_NOTIMPL;
    CComBSTR source(L"@mozilla.XPCDispatchTearOff");
    result = pCreateError->SetSource(source);
    if(FAILED(result))
        return E_NOTIMPL;
    result = SetErrorInfo(0, pError);
    if(FAILED(result))
        return E_NOTIMPL;
    return hResult;
}


Generated by  Doxygen 1.6.0   Back to index