Partager via


ICreateErrorInfo::SetSource (Compact 2013)

3/26/2014

This method sets the language-dependent programmatic identifier for the class or application that raised the error.

Syntax

HRESULT SetSource( 
  LPCOLESTR szSource
);

Parameters

  • szSource
    [in] Null-terminated string that contains the programmatic identifier in the form progname.objectname.

Return Value

If the method succeeds, the return value is S_OK.

If there is insufficient memory to complete the operation, the return value is E_OUTOFMEMORY.

Remarks

SetSource should be used to identify the class or application that is the source of the error. The language for the returned programmatic identifier 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);

Requirements

Header

oaidl.h,
oaidl.idl

Library

oleaut32.lib,
uuid.lib

See Also

Reference

ICreateErrorInfo