+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
98 template <
class _Other>
-
-
-
-
102 other->QueryInterface(__uuidof(T), (
void**)&
m_h);
-
-
-
110 template <
class _Other>
-
-
-
113 other->QueryInterface(__uuidof(T), (
void**)&
m_h);
-
-
-
-
-
-
-
-
-
130 template <
class _Other>
-
-
-
-
-
135 return m_h->QueryInterface(__uuidof(_Other), (
void**)h);
-
-
-
143 template <
class _Other>
-
-
-
-
-
148 HRESULT hr =
m_h->QueryInterface(__uuidof(_Other), (
void**)&_h);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
192 bstr(_In_ LPCOLESTR src)
noexcept
-
-
194 m_h = SysAllocString(src);
-
-
-
200 bstr(_In_ LPCOLESTR src, _In_ UINT len)
noexcept
-
-
202 m_h = SysAllocStringLen(src, len);
-
-
-
208 template<
class _Traits,
class _Ax>
-
209 bstr(_In_
const std::basic_string<wchar_t, _Traits, _Ax> &src)
noexcept
-
-
211 m_h = SysAllocStringLen(src.c_str(), (UINT)src.length());
-
-
-
-
-
-
-
-
-
-
-
232 return SysStringLen(
m_h);
-
-
-
-
-
-
-
-
-
-
-
257 return SysAllocStringLen(h, SysStringLen(h));
-
-
-
-
264 #pragma warning(push)
-
265 #pragma warning(disable: 26432)
-
-
-
-
-
-
-
-
-
-
-
-
283 const HRESULT hr = VariantCopy(
this, &varSrc);
-
-
-
-
-
291 #pragma warning(suppress: 26495)
-
-
-
294 memcpy(
this, &varSrc,
sizeof(VARIANT));
-
295 varSrc.vt = VT_EMPTY;
-
-
-
-
-
-
304 boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
346 variant(_In_
int nSrc, _In_ VARTYPE vtSrc = VT_I4)
noexcept
-
-
348 assert(vtSrc == VT_I4 || vtSrc == VT_INT);
-
-
-
-
-
356 variant(_In_
unsigned int nSrc, _In_ VARTYPE vtSrc = VT_UI4)
noexcept
-
-
358 assert(vtSrc == VT_UI4 || vtSrc == VT_UINT);
-
-
-
-
-
366 variant(_In_
long nSrc, _In_ VARTYPE vtSrc = VT_I4)
noexcept
-
-
368 assert(vtSrc == VT_I4 || vtSrc == VT_ERROR);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
394 variant(_In_
double dblSrc, _In_ VARTYPE vtSrc = VT_R8)
noexcept
-
-
396 assert(vtSrc == VT_R8 || vtSrc == VT_DATE);
-
-
-
-
-
-
-
-
-
-
-
413 variant(_In_
unsigned long long nSrc)
noexcept
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
455 if (pdispVal != NULL)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
476 assert(pSrc != NULL);
-
-
-
479 const HRESULT hr = SafeArrayCopy(
const_cast<LPSAFEARRAY
>(pSrc), &pCopy);
-
-
-
-
483 SafeArrayGetVartype(
const_cast<LPSAFEARRAY
>(pSrc), &vt);
-
-
-
-
-
-
-
-
-
-
-
-
501 if (
this != &varSrc) {
-
502 const HRESULT hr = VariantCopy(
this, &varSrc);
-
-
-
-
-
-
-
-
-
514 if (
this != &varSrc) {
-
-
516 memcpy(
this, &varSrc,
sizeof(VARIANT));
-
517 varSrc.vt = VT_EMPTY;
-
-
-
-
-
-
-
-
-
-
-
531 boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
713 bstrVal = SysAllocString(lpszSrc);
-
-
-
-
-
-
-
-
-
725 if (pdispVal != NULL)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
748 if (vt != (VT_UI1|VT_BYREF)) {
-
-
750 vt = VT_UI1|VT_BYREF;
-
-
-
-
-
-
-
-
761 if (vt != (VT_I2|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
774 if (vt != (VT_UI2|VT_BYREF)) {
-
-
776 vt = VT_UI2|VT_BYREF;
-
-
-
-
-
-
-
-
787 if (vt != (VT_I4|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
800 if (vt != (VT_UI4|VT_BYREF)) {
-
-
802 vt = VT_UI4|VT_BYREF;
-
-
-
-
-
-
-
-
813 if (vt != (VT_I4|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
826 if (vt != (VT_UI4|VT_BYREF)) {
-
-
828 vt = VT_UI4|VT_BYREF;
-
-
-
-
-
-
-
-
839 if (vt != (VT_I8|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
852 if (vt != (VT_UI8|VT_BYREF)) {
-
-
854 vt = VT_UI8|VT_BYREF;
-
-
-
-
-
-
-
-
865 if (vt != (VT_R4|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
878 if (vt != (VT_R8|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
891 assert(pSrc != NULL);
-
-
-
-
895 const HRESULT hr = SafeArrayCopy(
const_cast<LPSAFEARRAY
>(pSrc), &pCopy);
-
-
897 SafeArrayGetVartype(
const_cast<LPSAFEARRAY
>(pSrc), &vt);
-
-
-
-
-
-
-
-
-
-
-
-
917 if (vt == VT_NULL && varSrc.vt == VT_NULL)
return true;
-
918 if (vt != varSrc.vt)
return false;
-
919 return compare(
static_cast<const VARIANT&
>(*
this), varSrc, LOCALE_USER_DEFAULT, 0) ==
static_cast<HRESULT
>(VARCMP_EQ);
-
-
-
-
-
-
-
-
943 bool operator<(_In_
const VARIANT& varSrc)
const noexcept
-
-
945 if (vt == VT_NULL && varSrc.vt == VT_NULL)
return false;
-
946 return compare(
static_cast<const VARIANT&
>(*
this), varSrc, LOCALE_USER_DEFAULT, 0)==
static_cast<HRESULT
>(VARCMP_LT);
-
-
-
957 bool operator>(_In_
const VARIANT& varSrc)
const noexcept
-
-
959 if (vt == VT_NULL && varSrc.vt == VT_NULL)
return false;
-
960 return compare(
static_cast<const VARIANT&
>(*
this), varSrc, LOCALE_USER_DEFAULT, 0)==
static_cast<HRESULT
>(VARCMP_GT);
-
-
-
-
-
-
-
-
-
-
-
-
-
994 HRESULT
change_type(_In_ VARTYPE _vt, _In_opt_ USHORT wFlags = 0) noexcept
-
-
996 return VariantChangeType(
this,
this, wFlags, _vt);
-
-
-
-
1001 HRESULT compare(_In_
const VARIANT &varLeft, _In_
const VARIANT &varRight, _In_ LCID lcid, _In_ ULONG dwFlags)
const noexcept
-
-
-
1004 case VT_I1:
return varLeft.cVal == varRight.cVal ? VARCMP_EQ : varLeft.cVal > varRight.cVal ? VARCMP_GT : VARCMP_LT;
-
1005 case VT_UI2:
return varLeft.uiVal == varRight.uiVal ? VARCMP_EQ : varLeft.uiVal > varRight.uiVal ? VARCMP_GT : VARCMP_LT;
-
1006 case VT_UI4:
return varLeft.uintVal == varRight.uintVal ? VARCMP_EQ : varLeft.uintVal > varRight.uintVal ? VARCMP_GT : VARCMP_LT;
-
1007 case VT_UI8:
return varLeft.ullVal == varRight.ullVal ? VARCMP_EQ : varLeft.ullVal > varRight.ullVal ? VARCMP_GT : VARCMP_LT;
-
1008 default:
return VarCmp(
const_cast<LPVARIANT
>(&varLeft),
const_cast<LPVARIANT
>(&varRight), lcid, dwFlags);
-
-
-
-
1013 #pragma warning(pop)
-
-
-
-
-
-
-
-
-
-
1031 m_result = CoInitialize(pvReserved);
-
-
-
-
-
1041 m_result = CoInitializeEx(pvReserved, dwCoInit);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
92 template <
class _Other>
+
+
+
+
96 other->QueryInterface(__uuidof(T), (
void**)&
m_h);
+
+
+
104 template <
class _Other>
+
+
+
107 other->QueryInterface(__uuidof(T), (
void**)&
m_h);
+
+
+
+
+
+
+
+
+
124 template <
class _Other>
+
+
+
+
+
129 return m_h->QueryInterface(__uuidof(_Other), (
void**)h);
+
+
+
137 template <
class _Other>
+
+
+
+
+
142 HRESULT hr =
m_h->QueryInterface(__uuidof(_Other), (
void**)&_h);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
186 bstr(_In_ LPCOLESTR src)
noexcept
+
+
188 m_h = SysAllocString(src);
+
+
+
194 bstr(_In_ LPCOLESTR src, _In_ UINT len)
noexcept
+
+
196 m_h = SysAllocStringLen(src, len);
+
+
+
202 template<
class _Traits,
class _Ax>
+
203 bstr(_In_
const std::basic_string<wchar_t, _Traits, _Ax> &src)
noexcept
+
+
205 m_h = SysAllocStringLen(src.c_str(), (UINT)src.length());
+
+
+
+
+
+
+
+
+
+
+
226 return SysStringLen(
m_h);
+
+
+
+
+
+
+
+
+
+
+
251 return SysAllocStringLen(h, SysStringLen(h));
+
+
+
+
258 #pragma warning(push)
+
259 #pragma warning(disable: 26432)
+
+
+
+
+
+
+
+
+
+
+
+
277 const HRESULT hr = VariantCopy(
this, &varSrc);
+
+
+
+
+
285 #pragma warning(suppress: 26495)
+
+
+
288 memcpy(
this, &varSrc,
sizeof(VARIANT));
+
289 varSrc.vt = VT_EMPTY;
+
+
+
+
+
+
298 boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
340 variant(_In_
int nSrc, _In_ VARTYPE vtSrc = VT_I4)
noexcept
+
+
342 assert(vtSrc == VT_I4 || vtSrc == VT_INT);
+
+
+
+
+
350 variant(_In_
unsigned int nSrc, _In_ VARTYPE vtSrc = VT_UI4)
noexcept
+
+
352 assert(vtSrc == VT_UI4 || vtSrc == VT_UINT);
+
+
+
+
+
360 variant(_In_
long nSrc, _In_ VARTYPE vtSrc = VT_I4)
noexcept
+
+
362 assert(vtSrc == VT_I4 || vtSrc == VT_ERROR);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
388 variant(_In_
double dblSrc, _In_ VARTYPE vtSrc = VT_R8)
noexcept
+
+
390 assert(vtSrc == VT_R8 || vtSrc == VT_DATE);
+
+
+
+
+
+
+
+
+
+
+
407 variant(_In_
unsigned long long nSrc)
noexcept
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
449 if (pdispVal != NULL)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
470 assert(pSrc != NULL);
+
+
+
473 const HRESULT hr = SafeArrayCopy(
const_cast<LPSAFEARRAY
>(pSrc), &pCopy);
+
+
+
+
477 SafeArrayGetVartype(
const_cast<LPSAFEARRAY
>(pSrc), &vt);
+
+
+
+
+
+
+
+
+
+
+
+
495 if (
this != &varSrc) {
+
496 const HRESULT hr = VariantCopy(
this, &varSrc);
+
+
+
+
+
+
+
+
+
508 if (
this != &varSrc) {
+
+
510 memcpy(
this, &varSrc,
sizeof(VARIANT));
+
511 varSrc.vt = VT_EMPTY;
+
+
+
+
+
+
+
+
+
+
+
525 boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
707 bstrVal = SysAllocString(lpszSrc);
+
+
+
+
+
+
+
+
+
719 if (pdispVal != NULL)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
742 if (vt != (VT_UI1|VT_BYREF)) {
+
+
744 vt = VT_UI1|VT_BYREF;
+
+
+
+
+
+
+
+
755 if (vt != (VT_I2|VT_BYREF)) {
+
+
+
+
+
+
+
+
+
+
768 if (vt != (VT_UI2|VT_BYREF)) {
+
+
770 vt = VT_UI2|VT_BYREF;
+
+
+
+
+
+
+
+
781 if (vt != (VT_I4|VT_BYREF)) {
+
+
+
+
+
+
+
+
+
+
794 if (vt != (VT_UI4|VT_BYREF)) {
+
+
796 vt = VT_UI4|VT_BYREF;
+
+
+
+
+
+
+
+
807 if (vt != (VT_I4|VT_BYREF)) {
+
+
+
+
+
+
+
+
+
+
820 if (vt != (VT_UI4|VT_BYREF)) {
+
+
822 vt = VT_UI4|VT_BYREF;
+
+
+
+
+
+
+
+
833 if (vt != (VT_I8|VT_BYREF)) {
+
+
+
+
+
+
+
+
+
+
846 if (vt != (VT_UI8|VT_BYREF)) {
+
+
848 vt = VT_UI8|VT_BYREF;
+
+
+
+
+
+
+
+
859 if (vt != (VT_R4|VT_BYREF)) {
+
+
+
+
+
+
+
+
+
+
872 if (vt != (VT_R8|VT_BYREF)) {
+
+
+
+
+
+
+
+
+
+
885 assert(pSrc != NULL);
+
+
+
+
889 const HRESULT hr = SafeArrayCopy(
const_cast<LPSAFEARRAY
>(pSrc), &pCopy);
+
+
891 SafeArrayGetVartype(
const_cast<LPSAFEARRAY
>(pSrc), &vt);
+
+
+
+
+
+
+
+
+
+
+
+
911 if (vt == VT_NULL && varSrc.vt == VT_NULL)
return true;
+
912 if (vt != varSrc.vt)
return false;
+
913 return compare(
static_cast<const VARIANT&
>(*
this), varSrc, LOCALE_USER_DEFAULT, 0) ==
static_cast<HRESULT
>(VARCMP_EQ);
+
+
+
+
+
+
+
+
937 bool operator<(_In_
const VARIANT& varSrc)
const noexcept
+
+
939 if (vt == VT_NULL && varSrc.vt == VT_NULL)
return false;
+
940 return compare(
static_cast<const VARIANT&
>(*
this), varSrc, LOCALE_USER_DEFAULT, 0)==
static_cast<HRESULT
>(VARCMP_LT);
+
+
+
951 bool operator>(_In_
const VARIANT& varSrc)
const noexcept
+
+
953 if (vt == VT_NULL && varSrc.vt == VT_NULL)
return false;
+
954 return compare(
static_cast<const VARIANT&
>(*
this), varSrc, LOCALE_USER_DEFAULT, 0)==
static_cast<HRESULT
>(VARCMP_GT);
+
+
+
+
+
+
+
+
+
+
+
+
+
988 HRESULT
change_type(_In_ VARTYPE _vt, _In_opt_ USHORT wFlags = 0) noexcept
+
+
990 return VariantChangeType(
this,
this, wFlags, _vt);
+
+
+
+
995 HRESULT compare(_In_
const VARIANT &varLeft, _In_
const VARIANT &varRight, _In_ LCID lcid, _In_ ULONG dwFlags)
const noexcept
+
+
+
998 case VT_I1:
return varLeft.cVal == varRight.cVal ? VARCMP_EQ : varLeft.cVal > varRight.cVal ? VARCMP_GT : VARCMP_LT;
+
999 case VT_UI2:
return varLeft.uiVal == varRight.uiVal ? VARCMP_EQ : varLeft.uiVal > varRight.uiVal ? VARCMP_GT : VARCMP_LT;
+
1000 case VT_UI4:
return varLeft.uintVal == varRight.uintVal ? VARCMP_EQ : varLeft.uintVal > varRight.uintVal ? VARCMP_GT : VARCMP_LT;
+
1001 case VT_UI8:
return varLeft.ullVal == varRight.ullVal ? VARCMP_EQ : varLeft.ullVal > varRight.ullVal ? VARCMP_GT : VARCMP_LT;
+
1002 default:
return VarCmp(
const_cast<LPVARIANT
>(&varLeft),
const_cast<LPVARIANT
>(&varRight), lcid, dwFlags);
+
+
+
+
1007 #pragma warning(pop)
+
+
+
+
+
+
+
+
+
+
1025 m_result = CoInitialize(pvReserved);
+
+
+
+
+
1035 m_result = CoInitializeEx(pvReserved, dwCoInit);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
1084 HRESULT hr =
CoCreateInstance(rclsid, pUnkOuter, dwClsContext, __uuidof(T), (LPVOID*)&ppv);
-
-
-
-
-
-
-
BSTR string wrapper.
Definition: COM.h:185
-
bstr(LPCOLESTR src) noexcept
Constructs BSTR from OLE string.
Definition: COM.h:192
-
virtual ~bstr()
Destroys the string.
Definition: COM.h:219
-
handle_type duplicate_internal(handle_type h) const noexcept override
Duplicates the string.
Definition: COM.h:255
-
bstr(const std::basic_string< wchar_t, _Traits, _Ax > &src) noexcept
Constructs BSTR from std::basic_string.
Definition: COM.h:209
-
bstr(LPCOLESTR src, UINT len) noexcept
Constructs BSTR from OLE string with length.
Definition: COM.h:200
-
void free_internal() noexcept override
Destroys the string.
Definition: COM.h:241
-
UINT length() const noexcept
Returns the length of the string.
Definition: COM.h:230
-
Context scope automatic COM (un)initialization.
Definition: COM.h:1019
-
com_initializer(LPVOID pvReserved, DWORD dwCoInit) noexcept
Initializes the COM library for use by the calling thread, sets the thread's concurrency model,...
Definition: COM.h:1039
-
com_initializer(LPVOID pvReserved) noexcept
Initializes the COM library on the current thread and identifies the concurrency model as single-thre...
Definition: COM.h:1029
-
HRESULT status() const noexcept
Return result of CoInitialize() call.
Definition: COM.h:1060
-
virtual ~com_initializer()
Uninitializes COM.
Definition: COM.h:1049
-
HRESULT m_result
Result of CoInitialize call.
Definition: COM.h:1066
-
COM object wrapper template.
Definition: COM.h:89
-
void free_internal() noexcept override
Releases the object by decrementing reference counter.
Definition: COM.h:160
-
handle_type duplicate_internal(handle_type h) const noexcept override
Duplicates the object by incrementing the reference counter.
Definition: COM.h:174
-
HRESULT query_interface(_Other **h) const
Queries the object for another interface.
Definition: COM.h:131
-
HRESULT query_interface(com_obj< _Other > &h) const
Queries the object for another interface.
Definition: COM.h:144
-
virtual ~com_obj()
Releases object.
Definition: COM.h:119
-
com_obj(_Other *other)
Queries the object for another interface and creates new class with it.
Definition: COM.h:99
-
com_obj(com_obj< _Other > &other)
Queries the object for another interface and creates new class with it.
Definition: COM.h:111
-
COM runtime error.
Definition: COM.h:32
-
com_runtime_error(error_type num, const std::string &msg)
Constructs an exception.
Definition: COM.h:40
-
com_runtime_error(error_type num, const char *msg=nullptr)
Constructs an exception.
Definition: COM.h:50
-
Base abstract template class to support object handle keeping for objects that support trivial handle...
Definition: Common.h:877
-
T * handle_type
Datatype of the object handle this template class handles.
Definition: Common.h:620
-
handle_type m_h
Object handle.
Definition: Common.h:866
-
Numerical runtime error.
Definition: Common.h:1011
-
HRESULT error_type
Error number type.
Definition: Common.h:1013
-
VARIANT struct wrapper.
Definition: COM.h:267
-
bool operator<=(const VARIANT &varSrc) const noexcept
Is variant less than or equal to?
Definition: COM.h:971
-
variant(bool bSrc) noexcept
Constructs VARIANT from bool.
Definition: COM.h:301
-
variant & operator=(unsigned int nSrc) noexcept
Copy from unsigned int value.
Definition: COM.h:603
-
variant & operator=(unsigned long nSrc) noexcept
Copy from unsigned long value.
Definition: COM.h:629
-
variant(float fltSrc) noexcept
Constructs VARIANT from float.
Definition: COM.h:385
-
variant(VARIANT &&varSrc) noexcept
Moves VARIANT from another.
Definition: COM.h:292
-
variant & operator=(float fltSrc) noexcept
Copy from float value.
Definition: COM.h:669
-
variant & operator=(float *pfSrc) noexcept
Copy from float reference.
Definition: COM.h:863
-
variant(IDispatch *pSrc)
Constructs VARIANT from IDispatch.
Definition: COM.h:450
-
variant(int nSrc, VARTYPE vtSrc=VT_I4) noexcept
Constructs VARIANT from integer.
Definition: COM.h:346
-
variant(const SAFEARRAY *pSrc)
Constructs VARIANT from SAFEARRAY.
Definition: COM.h:474
-
variant & operator=(double *pfSrc) noexcept
Copy from double reference.
Definition: COM.h:876
-
variant & operator=(int *pnSrc) noexcept
Copy from int reference.
Definition: COM.h:785
-
bool operator>(const VARIANT &varSrc) const noexcept
Is variant greater than?
Definition: COM.h:957
-
variant & operator=(bool bSrc) noexcept
Copy from bool value.
Definition: COM.h:525
-
variant & operator=(long nSrc) noexcept
Copy from long value.
Definition: COM.h:616
-
variant & operator=(const SAFEARRAY *pSrc) noexcept
Copy from SAFEARRAY.
Definition: COM.h:889
-
HRESULT change_type(VARTYPE _vt, USHORT wFlags=0) noexcept
Converts a variant from one type to another.
Definition: COM.h:994
-
variant & operator=(IUnknown *pSrc)
Copy from IUnknown.
Definition: COM.h:733
-
variant & operator=(short nSrc) noexcept
Copy from short value.
Definition: COM.h:564
-
variant & operator=(unsigned char *pbSrc) noexcept
Copy from unsigned char reference.
Definition: COM.h:746
-
variant & operator=(unsigned short nSrc) noexcept
Copy from unsigned short value.
Definition: COM.h:577
-
variant & operator=(unsigned char nSrc) noexcept
Copy from unsigned char value.
Definition: COM.h:551
-
variant & operator=(char cSrc) noexcept
Copy from char value.
Definition: COM.h:538
-
variant(LPCOLESTR lpszSrc) noexcept
Constructs VARIANT from OLE string.
Definition: COM.h:432
-
virtual ~variant()
Destroys VARIANT.
Definition: COM.h:491
-
variant(const VARIANT &varSrc)
Constructs VARIANT from another.
Definition: COM.h:280
-
variant(unsigned char nSrc) noexcept
Constructs VARIANT from byte.
Definition: COM.h:319
-
variant & operator=(double dblSrc) noexcept
Copy from double value.
Definition: COM.h:682
-
bool operator!=(const VARIANT &varSrc) const noexcept
Is variant not equal to?
Definition: COM.h:930
-
variant & operator=(int nSrc) noexcept
Copy from int value.
Definition: COM.h:590
-
variant(unsigned long nSrc) noexcept
Constructs VARIANT from unsigned long.
Definition: COM.h:376
-
bool operator==(const VARIANT &varSrc) const noexcept
Is variant equal to?
Definition: COM.h:915
-
variant(IUnknown *pSrc)
Constructs VARIANT from IUnknown.
Definition: COM.h:462
-
variant(unsigned int nSrc, VARTYPE vtSrc=VT_UI4) noexcept
Constructs VARIANT from unsigned integer.
Definition: COM.h:356
-
variant & operator=(CY cySrc) noexcept
Copy from CY value.
Definition: COM.h:695
-
variant & operator=(LPCOLESTR lpszSrc) noexcept
Copy from OLE string value.
Definition: COM.h:709
-
variant(long long nSrc) noexcept
Constructs VARIANT from 64-bit integer.
Definition: COM.h:404
-
variant & operator=(unsigned int *pnSrc) noexcept
Copy from unsigned int reference.
Definition: COM.h:798
-
variant(long nSrc, VARTYPE vtSrc=VT_I4) noexcept
Constructs VARIANT from long.
Definition: COM.h:366
-
variant & operator=(long *pnSrc) noexcept
Copy from long reference.
Definition: COM.h:811
-
variant(unsigned short nSrc) noexcept
Constructs VARIANT from unsigned short.
Definition: COM.h:337
-
bool operator>=(const VARIANT &varSrc) const noexcept
Is variant greater than or equal to?
Definition: COM.h:984
-
variant & operator=(short *pnSrc) noexcept
Copy from short reference.
Definition: COM.h:759
-
variant() noexcept
Constructs blank VARIANT.
Definition: COM.h:272
-
bool operator<(const VARIANT &varSrc) const noexcept
Is variant less than?
Definition: COM.h:943
-
variant(unsigned long long nSrc) noexcept
Constructs VARIANT from unsigned integer.
Definition: COM.h:413
-
variant(char cSrc) noexcept
Constructs VARIANT from character.
Definition: COM.h:310
-
variant & operator=(unsigned short *pnSrc) noexcept
Copy from unsigned short reference.
Definition: COM.h:772
-
variant & operator=(long long *pnSrc) noexcept
Copy from long long reference.
Definition: COM.h:837
-
variant(BSTR bstr) noexcept
Constructs VARIANT from BSTR.
Definition: COM.h:441
-
variant & operator=(unsigned long long *pnSrc) noexcept
Copy from unsigned long long reference.
Definition: COM.h:850
-
variant(double dblSrc, VARTYPE vtSrc=VT_R8) noexcept
Constructs VARIANT from double or variant date.
Definition: COM.h:394
-
variant(short nSrc) noexcept
Constructs VARIANT from short.
Definition: COM.h:328
-
variant(CY cySrc) noexcept
Constructs VARIANT from CY (64-bit integer)
Definition: COM.h:422
-
variant & operator=(unsigned long long nSrc) noexcept
Copy from unsigned long long value.
Definition: COM.h:655
-
variant & operator=(VARIANT &&varSrc) noexcept
Moves from another VARIANT.
Definition: COM.h:512
-
variant & operator=(long long nSrc) noexcept
Copy from long long value.
Definition: COM.h:642
-
variant & operator=(IDispatch *pSrc)
Copy from IDispatch.
Definition: COM.h:720
-
variant & operator=(unsigned long *pnSrc) noexcept
Copy from unsigned long reference.
Definition: COM.h:824
-
variant & operator=(const VARIANT &varSrc)
Copy from another VARIANT.
Definition: COM.h:499
-
static _Check_return_ HRESULT CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, winstd::com_obj< T > &v)
Creates and default-initializes a single object of the class associated with a specified CLSID.
Definition: COM.h:1081
-
#define WINSTD_NONCOPYABLE(C)
Declares a class as non-copyable.
Definition: Common.h:74
-
#define WINSTD_NONMOVABLE(C)
Declares a class as non-movable.
Definition: Common.h:82
-
#define WINSTD_DPLHANDLE_IMPL(C, INVAL)
Implements default constructors and operators to prevent their auto-generation by compiler.
Definition: Common.h:183
-
static const T * invalid
Invalid handle value.
Definition: Common.h:625
-
Deleter for unique_ptr using CoTaskMemFree.
Definition: COM.h:64
-
void operator()(_T *_Ptr) const
Delete a pointer.
Definition: COM.h:76
-
CoTaskMemFree_delete() noexcept
Default constructor.
Definition: COM.h:68
+
+
+
+
+
1078 HRESULT hr =
CoCreateInstance(rclsid, pUnkOuter, dwClsContext, __uuidof(T), (LPVOID*)&ppv);
+
+
+
+
+
+
BSTR string wrapper.
Definition: COM.h:179
+
bstr(LPCOLESTR src) noexcept
Constructs BSTR from OLE string.
Definition: COM.h:186
+
virtual ~bstr()
Destroys the string.
Definition: COM.h:213
+
handle_type duplicate_internal(handle_type h) const noexcept override
Duplicates the string.
Definition: COM.h:249
+
bstr(const std::basic_string< wchar_t, _Traits, _Ax > &src) noexcept
Constructs BSTR from std::basic_string.
Definition: COM.h:203
+
bstr(LPCOLESTR src, UINT len) noexcept
Constructs BSTR from OLE string with length.
Definition: COM.h:194
+
void free_internal() noexcept override
Destroys the string.
Definition: COM.h:235
+
UINT length() const noexcept
Returns the length of the string.
Definition: COM.h:224
+
Context scope automatic COM (un)initialization.
Definition: COM.h:1013
+
com_initializer(LPVOID pvReserved, DWORD dwCoInit) noexcept
Initializes the COM library for use by the calling thread, sets the thread's concurrency model,...
Definition: COM.h:1033
+
com_initializer(LPVOID pvReserved) noexcept
Initializes the COM library on the current thread and identifies the concurrency model as single-thre...
Definition: COM.h:1023
+
HRESULT status() const noexcept
Return result of CoInitialize() call.
Definition: COM.h:1054
+
virtual ~com_initializer()
Uninitializes COM.
Definition: COM.h:1043
+
HRESULT m_result
Result of CoInitialize call.
Definition: COM.h:1060
+
COM object wrapper template.
Definition: COM.h:83
+
void free_internal() noexcept override
Releases the object by decrementing reference counter.
Definition: COM.h:154
+
handle_type duplicate_internal(handle_type h) const noexcept override
Duplicates the object by incrementing the reference counter.
Definition: COM.h:168
+
HRESULT query_interface(_Other **h) const
Queries the object for another interface.
Definition: COM.h:125
+
HRESULT query_interface(com_obj< _Other > &h) const
Queries the object for another interface.
Definition: COM.h:138
+
virtual ~com_obj()
Releases object.
Definition: COM.h:113
+
com_obj(_Other *other)
Queries the object for another interface and creates new class with it.
Definition: COM.h:93
+
com_obj(com_obj< _Other > &other)
Queries the object for another interface and creates new class with it.
Definition: COM.h:105
+
COM runtime error.
Definition: COM.h:26
+
com_runtime_error(error_type num, const std::string &msg)
Constructs an exception.
Definition: COM.h:34
+
com_runtime_error(error_type num, const char *msg=nullptr)
Constructs an exception.
Definition: COM.h:44
+
Base abstract template class to support object handle keeping for objects that support trivial handle...
Definition: Common.h:869
+
T * handle_type
Datatype of the object handle this template class handles.
Definition: Common.h:612
+
handle_type m_h
Object handle.
Definition: Common.h:858
+
Numerical runtime error.
Definition: Common.h:1003
+
HRESULT error_type
Error number type.
Definition: Common.h:1005
+
VARIANT struct wrapper.
Definition: COM.h:261
+
bool operator<=(const VARIANT &varSrc) const noexcept
Is variant less than or equal to?
Definition: COM.h:965
+
variant(bool bSrc) noexcept
Constructs VARIANT from bool.
Definition: COM.h:295
+
variant & operator=(unsigned int nSrc) noexcept
Copy from unsigned int value.
Definition: COM.h:597
+
variant & operator=(unsigned long nSrc) noexcept
Copy from unsigned long value.
Definition: COM.h:623
+
variant(float fltSrc) noexcept
Constructs VARIANT from float.
Definition: COM.h:379
+
variant(VARIANT &&varSrc) noexcept
Moves VARIANT from another.
Definition: COM.h:286
+
variant & operator=(float fltSrc) noexcept
Copy from float value.
Definition: COM.h:663
+
variant & operator=(float *pfSrc) noexcept
Copy from float reference.
Definition: COM.h:857
+
variant(IDispatch *pSrc)
Constructs VARIANT from IDispatch.
Definition: COM.h:444
+
variant(int nSrc, VARTYPE vtSrc=VT_I4) noexcept
Constructs VARIANT from integer.
Definition: COM.h:340
+
variant(const SAFEARRAY *pSrc)
Constructs VARIANT from SAFEARRAY.
Definition: COM.h:468
+
variant & operator=(double *pfSrc) noexcept
Copy from double reference.
Definition: COM.h:870
+
variant & operator=(int *pnSrc) noexcept
Copy from int reference.
Definition: COM.h:779
+
bool operator>(const VARIANT &varSrc) const noexcept
Is variant greater than?
Definition: COM.h:951
+
variant & operator=(bool bSrc) noexcept
Copy from bool value.
Definition: COM.h:519
+
variant & operator=(long nSrc) noexcept
Copy from long value.
Definition: COM.h:610
+
variant & operator=(const SAFEARRAY *pSrc) noexcept
Copy from SAFEARRAY.
Definition: COM.h:883
+
HRESULT change_type(VARTYPE _vt, USHORT wFlags=0) noexcept
Converts a variant from one type to another.
Definition: COM.h:988
+
variant & operator=(IUnknown *pSrc)
Copy from IUnknown.
Definition: COM.h:727
+
variant & operator=(short nSrc) noexcept
Copy from short value.
Definition: COM.h:558
+
variant & operator=(unsigned char *pbSrc) noexcept
Copy from unsigned char reference.
Definition: COM.h:740
+
variant & operator=(unsigned short nSrc) noexcept
Copy from unsigned short value.
Definition: COM.h:571
+
variant & operator=(unsigned char nSrc) noexcept
Copy from unsigned char value.
Definition: COM.h:545
+
variant & operator=(char cSrc) noexcept
Copy from char value.
Definition: COM.h:532
+
variant(LPCOLESTR lpszSrc) noexcept
Constructs VARIANT from OLE string.
Definition: COM.h:426
+
virtual ~variant()
Destroys VARIANT.
Definition: COM.h:485
+
variant(const VARIANT &varSrc)
Constructs VARIANT from another.
Definition: COM.h:274
+
variant(unsigned char nSrc) noexcept
Constructs VARIANT from byte.
Definition: COM.h:313
+
variant & operator=(double dblSrc) noexcept
Copy from double value.
Definition: COM.h:676
+
bool operator!=(const VARIANT &varSrc) const noexcept
Is variant not equal to?
Definition: COM.h:924
+
variant & operator=(int nSrc) noexcept
Copy from int value.
Definition: COM.h:584
+
variant(unsigned long nSrc) noexcept
Constructs VARIANT from unsigned long.
Definition: COM.h:370
+
bool operator==(const VARIANT &varSrc) const noexcept
Is variant equal to?
Definition: COM.h:909
+
variant(IUnknown *pSrc)
Constructs VARIANT from IUnknown.
Definition: COM.h:456
+
variant(unsigned int nSrc, VARTYPE vtSrc=VT_UI4) noexcept
Constructs VARIANT from unsigned integer.
Definition: COM.h:350
+
variant & operator=(CY cySrc) noexcept
Copy from CY value.
Definition: COM.h:689
+
variant & operator=(LPCOLESTR lpszSrc) noexcept
Copy from OLE string value.
Definition: COM.h:703
+
variant(long long nSrc) noexcept
Constructs VARIANT from 64-bit integer.
Definition: COM.h:398
+
variant & operator=(unsigned int *pnSrc) noexcept
Copy from unsigned int reference.
Definition: COM.h:792
+
variant(long nSrc, VARTYPE vtSrc=VT_I4) noexcept
Constructs VARIANT from long.
Definition: COM.h:360
+
variant & operator=(long *pnSrc) noexcept
Copy from long reference.
Definition: COM.h:805
+
variant(unsigned short nSrc) noexcept
Constructs VARIANT from unsigned short.
Definition: COM.h:331
+
bool operator>=(const VARIANT &varSrc) const noexcept
Is variant greater than or equal to?
Definition: COM.h:978
+
variant & operator=(short *pnSrc) noexcept
Copy from short reference.
Definition: COM.h:753
+
variant() noexcept
Constructs blank VARIANT.
Definition: COM.h:266
+
bool operator<(const VARIANT &varSrc) const noexcept
Is variant less than?
Definition: COM.h:937
+
variant(unsigned long long nSrc) noexcept
Constructs VARIANT from unsigned integer.
Definition: COM.h:407
+
variant(char cSrc) noexcept
Constructs VARIANT from character.
Definition: COM.h:304
+
variant & operator=(unsigned short *pnSrc) noexcept
Copy from unsigned short reference.
Definition: COM.h:766
+
variant & operator=(long long *pnSrc) noexcept
Copy from long long reference.
Definition: COM.h:831
+
variant(BSTR bstr) noexcept
Constructs VARIANT from BSTR.
Definition: COM.h:435
+
variant & operator=(unsigned long long *pnSrc) noexcept
Copy from unsigned long long reference.
Definition: COM.h:844
+
variant(double dblSrc, VARTYPE vtSrc=VT_R8) noexcept
Constructs VARIANT from double or variant date.
Definition: COM.h:388
+
variant(short nSrc) noexcept
Constructs VARIANT from short.
Definition: COM.h:322
+
variant(CY cySrc) noexcept
Constructs VARIANT from CY (64-bit integer)
Definition: COM.h:416
+
variant & operator=(unsigned long long nSrc) noexcept
Copy from unsigned long long value.
Definition: COM.h:649
+
variant & operator=(VARIANT &&varSrc) noexcept
Moves from another VARIANT.
Definition: COM.h:506
+
variant & operator=(long long nSrc) noexcept
Copy from long long value.
Definition: COM.h:636
+
variant & operator=(IDispatch *pSrc)
Copy from IDispatch.
Definition: COM.h:714
+
variant & operator=(unsigned long *pnSrc) noexcept
Copy from unsigned long reference.
Definition: COM.h:818
+
variant & operator=(const VARIANT &varSrc)
Copy from another VARIANT.
Definition: COM.h:493
+
static _Check_return_ HRESULT CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, winstd::com_obj< T > &v)
Creates and default-initializes a single object of the class associated with a specified CLSID.
Definition: COM.h:1075
+
#define WINSTD_NONCOPYABLE(C)
Declares a class as non-copyable.
Definition: Common.h:66
+
#define WINSTD_NONMOVABLE(C)
Declares a class as non-movable.
Definition: Common.h:74
+
#define WINSTD_DPLHANDLE_IMPL(C, INVAL)
Implements default constructors and operators to prevent their auto-generation by compiler.
Definition: Common.h:175
+
static const T * invalid
Invalid handle value.
Definition: Common.h:617
+
Deleter for unique_ptr using CoTaskMemFree.
Definition: COM.h:58
+
void operator()(_T *_Ptr) const
Delete a pointer.
Definition: COM.h:70
+
CoTaskMemFree_delete() noexcept
Default constructor.
Definition: COM.h:62