📄 errorinfo_functions.h
字号:
if(SUCCEEDED(hr))
{
hr = comstl__set_error_info_w_(description_w, source_w, guid, helpFile_w, helpContext);
}
STLSOFT_NS_GLOBAL(CoTaskMemFree)(description_w);
STLSOFT_NS_GLOBAL(CoTaskMemFree)(source_w);
STLSOFT_NS_GLOBAL(CoTaskMemFree)(helpFile_w);
return hr;
}
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/** \brief [C only] Sets the description of the current error object to the given Unicode string
*
* \ingroup group__library__error
*
* \see comstl::set_error_info_description
*/
STLSOFT_INLINE HRESULT comstl__set_error_info_description_w(cs_char_w_t const* description)
{
COMSTL_MESSAGE_ASSERT("error info description string cannot be NULL", NULL != description);
return comstl__set_error_info_w_(description, NULL, NULL, NULL, NULL);
}
/** \brief [C only] Sets the description of the current error object to the given ANSI string
*
* \ingroup group__library__error
*
* \see comstl::set_error_info_description
*/
STLSOFT_INLINE HRESULT comstl__set_error_info_description_a(cs_char_a_t const* description)
{
COMSTL_MESSAGE_ASSERT("error info description string cannot be NULL", NULL != description);
return comstl__set_error_info_a_(description, NULL, NULL, NULL, NULL);
}
/** \brief [C only] Sets the description and source of the current error object to the given Unicode strings
*
* \ingroup group__library__error
*
* \see comstl::set_error_info_description_and_source
*/
STLSOFT_INLINE HRESULT comstl__set_error_info_description_and_source_w(cs_char_w_t const* description, cs_char_w_t const* source)
{
COMSTL_MESSAGE_ASSERT("error info description string cannot be NULL", NULL != description);
COMSTL_MESSAGE_ASSERT("error info source string cannot be NULL", NULL != source);
return comstl__set_error_info_w_(description, source, NULL, NULL, NULL);
}
/** \brief [C only] Sets the description and source of the current error object to the given ANSI strings
*
* \ingroup group__library__error
*
* \see comstl::set_error_info_description_and_source
*/
STLSOFT_INLINE HRESULT comstl__set_error_info_description_and_source_a(cs_char_a_t const* description, cs_char_a_t const* source)
{
COMSTL_MESSAGE_ASSERT("error info description string cannot be NULL", NULL != description);
COMSTL_MESSAGE_ASSERT("error info source string cannot be NULL", NULL != source);
return comstl__set_error_info_a_(description, source, NULL, NULL, NULL);
}
/** \brief [C only] Sets the description, source, interface ID and help information of the current error object
*
* \ingroup group__library__error
*
* \see comstl::set_error_info
*/
STLSOFT_INLINE HRESULT comstl__set_error_info_w(cs_char_w_t const* description
, cs_char_w_t const* source
, REFGUID guid
, cs_char_w_t const* helpFile
, cs_dword_t helpContext)
{
COMSTL_MESSAGE_ASSERT("error info description string cannot be NULL", NULL != description);
COMSTL_MESSAGE_ASSERT("error info source string cannot be NULL", NULL != source);
COMSTL_MESSAGE_ASSERT("error info help file string cannot be NULL", NULL != helpFile);
return comstl__set_error_info_w_(description, source, COMSTL_REF_2_PTR(guid), helpFile, &helpContext);
}
/** \brief [C only] Sets the description, source, interface ID and help information of the current error object
*
* \ingroup group__library__error
*
* \see comstl::set_error_info
*/
STLSOFT_INLINE HRESULT comstl__set_error_info_a(cs_char_a_t const* description
, cs_char_a_t const* source
, REFGUID guid
, cs_char_a_t const* helpFile
, cs_dword_t helpContext)
{
COMSTL_MESSAGE_ASSERT("error info description string cannot be NULL", NULL != description);
COMSTL_MESSAGE_ASSERT("error info source string cannot be NULL", NULL != source);
COMSTL_MESSAGE_ASSERT("error info help file string cannot be NULL", NULL != helpFile);
return comstl__set_error_info_a_(description, source, COMSTL_REF_2_PTR(guid), helpFile, &helpContext);
}
/* /////////////////////////////////////////////////////////////////////////
* Namespace
*/
#ifdef STLSOFT_DOCUMENTATION_SKIP_SECTION
namespace comstl
{
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
* C++ functions
*/
#ifdef __cplusplus
/** \brief Sets the description of the current error object to the given ANSI string
*
* \ingroup group__library__error
*/
inline HRESULT set_error_info(cs_char_a_t const* description)
{
return comstl__set_error_info_description_a(description);
}
/** \brief Sets the description of the current error object to the given Unicode string
*
* \ingroup group__library__error
*
* \param description The error description
*/
inline HRESULT set_error_info(cs_char_w_t const* description)
{
return comstl__set_error_info_description_w(description);
}
/** \brief Sets the description and source of the current error object to the given ANSI string
*
* \ingroup group__library__error
*
* \param description The error description
* \param source The error source
*/
inline HRESULT set_error_info(cs_char_a_t const* description, cs_char_a_t const* source)
{
return comstl__set_error_info_description_and_source_a(description, source);
}
/** \brief Sets the description and source of the current error object to the given Unicode string
*
* \ingroup group__library__error
*
* \param description The error description
* \param source The error source
*/
inline HRESULT set_error_info(cs_char_w_t const* description, cs_char_w_t const* source)
{
return comstl__set_error_info_description_and_source_w(description, source);
}
/** \brief Sets the description, source and GUID of the current error object to the given ANSI string
*
* \ingroup group__library__error
*
* \param description The error description
* \param source The error source
* \param guid The GUID of the interface in error
*/
inline HRESULT set_error_info(cs_char_a_t const* description, cs_char_a_t const* source, REFGUID guid)
{
return comstl__set_error_info_a_(description, source, &guid, NULL, NULL);
}
/** \brief Sets the description, source and GUID of the current error object to the given Unicode string
*
* \ingroup group__library__error
*
* \param description The error description
* \param source The error source
* \param guid The GUID of the interface in error
*/
inline HRESULT set_error_info(cs_char_w_t const* description, cs_char_w_t const* source, REFGUID guid)
{
return comstl__set_error_info_w_(description, source, &guid, NULL, NULL);
}
#endif /* __cplusplus */
/* /////////////////////////////////////////////////////////////////////////
* Unit-testing
*/
#ifdef STLSOFT_UNITTEST
# include "./unittest/errorinfo_functions_unittest_.h"
#endif /* STLSOFT_UNITTEST */
/* ////////////////////////////////////////////////////////////////////// */
#ifndef _COMSTL_NO_NAMESPACE
# if defined(_STLSOFT_NO_NAMESPACE) || \
defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
} /* namespace comstl */
# else
} /* namespace comstl_project */
} /* namespace stlsoft */
# endif /* _STLSOFT_NO_NAMESPACE */
#endif /* !_COMSTL_NO_NAMESPACE */
/* ////////////////////////////////////////////////////////////////////// */
#endif /* !COMSTL_INCL_COMSTL_ERROR_H_ERRORINFO_FUNCTIONS */
/* ////////////////////////////////////////////////////////////////////// */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -