ICreateErrorInfo::SetSource

HRESULT SetSource(

LPCOLESTR  szSource  
);
 

Sets the language-dependent programmatic identifier (ProgID) for the class or application that raised the error.

Parameter

szSource
A ProgID in the form progname.objectname.

Return Value

The return value obtained from the returned HRESULT is one of the following:

Return value Meaning
S_OK Success.
E_OUTOFMEMORY Insufficient memory to complete the operation.

Comments

ICreateErrorInfo::SetSource should be used to identify the class or application that is the source of the error. The language for the returned ProgID depends on the locale identifier (LCID) that was passed to the method at the time of invocation.

Example

hr = CreateErrorInfo(&pcerrinfo);
if (m_excepinfo.bstrSource) 
    pcerrinfo->SetSource(m_excepinfo.bstrSource);