xentara-utils v2.0.4
The Xentara Utility Library
|
Windows COM functionality. More...
Namespaces | |
namespace | variantTypes |
Namespace containing Windows COM variant types. | |
Classes | |
class | Exception |
An exception that wraps an IErrorInfo COM object. More... | |
class | ObjectHandle |
A handle to a COM object. More... | |
class | String |
An COM string object. More... | |
class | ThreadEnvironment |
A class that initializes the COM interface. More... | |
class | Variant |
A COM variant object. More... | |
Functions | |
auto | throwError (HRESULT result, const std::string &message) -> void |
Throws an exception after a COM error. | |
auto | throwError (HRESULT result, const char *message) -> void |
Throws an exception after a COM error. | |
auto | throwError (HRESULT result, const std::error_category &errorCategory, const std::string &message) -> void |
Throws an exception after a COM error. | |
auto | throwError (HRESULT result, const std::error_category &errorCategory, const char *message) -> void |
Throws an exception after a COM error. | |
Windows COM functionality.
This namespace contains functionality related to the Windows Component Object Model (COM) interface.
auto xentara::utils::windows::com::throwError | ( | HRESULT | result, |
const char * | message | ||
) | -> void |
Throws an exception after a COM error.
This function should be called to throw an exception if a COM function returns an error. It will attempt to get a detailed error message by calling GetErrorInfo(), and throw an exception based on the returned error info. If no error info is available, it will throw an std::system_error using result as error code, and xentara::utils::windows::hresultErrorCategory() as error category.
This function should only be called if FAILED(result) is true (or for which SUCCEEDED(result) is false, which is the same thing).
#include <xentara/utils/windows/com/Errors.hpp>
result | The return value of the failed function |
message | A message describing the error |
Exception | This exception is thrown if extended error infomation was available |
std::system | error This exception is thrown if no extended error infomation was available |
auto xentara::utils::windows::com::throwError | ( | HRESULT | result, |
const std::error_category & | errorCategory, | ||
const char * | message | ||
) | -> void |
Throws an exception after a COM error.
This function should be called to throw an exception if a COM function returns an error. It will attempt to get a detailed error message by calling GetErrorInfo(), and throw an exception based on the returned error info. If no error info is available, it will throw an std::system_error using result as error code.
This function should only be called if FAILED(result) is true (or for which SUCCEEDED(result) is false, which is the same thing).
#include <xentara/utils/windows/com/Errors.hpp>
result | The return value of the failed function |
errorCategory | The error category to use if an std::system_error is thrown. This should either be xentara::utils::windows::hresultErrorcategory(), or a COM subsystem specific error category, like xentara::utils::windows::wmi::errorCategory(). |
message | A message describing the error |
Exception | This exception is thrown if extended error infomation was available |
std::system | error This exception is thrown if no extended error infomation was available |
auto xentara::utils::windows::com::throwError | ( | HRESULT | result, |
const std::error_category & | errorCategory, | ||
const std::string & | message | ||
) | -> void |
Throws an exception after a COM error.
This function should be called to throw an exception if a COM function returns an error. It will attempt to get a detailed error message by calling GetErrorInfo(), and throw an exception based on the returned error info. If no error info is available, it will throw an std::system_error using result as error code.
This function should only be called if FAILED(result) is true (or for which SUCCEEDED(result) is false, which is the same thing).
#include <xentara/utils/windows/com/Errors.hpp>
result | The return value of the failed function. |
errorCategory | The error category to use if an std::system_error is thrown. This should either be xentara::utils::windows::hresultErrorcategory(), or a COM subsystem specific error category, like xentara::utils::windows::wmi::errorCategory(). |
message | A message describing the error |
Exception | This exception is thrown if extended error infomation was available |
std::system | error This exception is thrown if no extended error infomation was available |
auto xentara::utils::windows::com::throwError | ( | HRESULT | result, |
const std::string & | message | ||
) | -> void |
Throws an exception after a COM error.
This function should be called to throw an exception if a COM function returns an error. It will attempt to get a detailed error message by calling GetErrorInfo(), and throw an exception based on the returned error info. If no error info is available, it will throw an std::system_error using result as error code, and xentara::utils::windows::hresultErrorCategory() as error category.
This function should only be called if FAILED(result) is true (or for which SUCCEEDED(result) is false, which is the same thing).
#include <xentara/utils/windows/com/Errors.hpp>
result | The return value of the failed function. |
message | A message describing the error |
Exception | This exception is thrown if extended error infomation was available |
std::system | error This exception is thrown if no extended error infomation was available |