-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
93 template <
class _Other>
-
-
-
-
97 other->QueryInterface(__uuidof(T), (
void**)&
m_h);
-
-
-
105 template <
class _Other>
-
-
-
108 other->QueryInterface(__uuidof(T), (
void**)&
m_h);
-
-
-
-
-
-
-
-
-
125 template <
class _Other>
-
-
-
-
-
130 return m_h->QueryInterface(__uuidof(_Other), (
void**)h);
-
-
-
138 template <
class _Other>
-
-
-
-
-
143 HRESULT hr =
m_h->QueryInterface(__uuidof(_Other), (
void**)&_h);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
187 bstr(_In_ LPCOLESTR src)
noexcept
-
-
189 m_h = SysAllocString(src);
-
-
-
195 bstr(_In_ LPCOLESTR src, _In_ UINT len)
noexcept
-
-
197 m_h = SysAllocStringLen(src, len);
-
-
-
203 template<
class _Traits,
class _Ax>
-
204 bstr(_In_
const std::basic_string<wchar_t, _Traits, _Ax> &src)
noexcept
-
-
206 m_h = SysAllocStringLen(src.c_str(), (UINT)src.length());
-
-
-
-
-
-
-
-
-
-
-
227 return SysStringLen(
m_h);
-
-
-
-
-
-
-
-
-
-
-
252 return SysAllocStringLen(h, SysStringLen(h));
-
-
-
-
259 #pragma warning(push)
-
260 #pragma warning(disable: 26432)
-
-
-
-
-
-
-
-
-
-
-
-
278 const HRESULT hr = VariantCopy(
this, &varSrc);
-
-
-
-
-
286 #pragma warning(suppress: 26495)
-
-
-
289 memcpy(
this, &varSrc,
sizeof(VARIANT));
-
290 varSrc.vt = VT_EMPTY;
-
-
-
-
-
-
299 boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
341 variant(_In_
int nSrc, _In_ VARTYPE vtSrc = VT_I4)
noexcept
-
-
343 assert(vtSrc == VT_I4 || vtSrc == VT_INT);
-
-
-
-
-
351 variant(_In_
unsigned int nSrc, _In_ VARTYPE vtSrc = VT_UI4)
noexcept
-
-
353 assert(vtSrc == VT_UI4 || vtSrc == VT_UINT);
-
-
-
-
-
361 variant(_In_
long nSrc, _In_ VARTYPE vtSrc = VT_I4)
noexcept
-
-
363 assert(vtSrc == VT_I4 || vtSrc == VT_ERROR);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
389 variant(_In_
double dblSrc, _In_ VARTYPE vtSrc = VT_R8)
noexcept
-
-
391 assert(vtSrc == VT_R8 || vtSrc == VT_DATE);
-
-
-
-
-
-
-
-
-
-
-
408 variant(_In_
unsigned long long nSrc)
noexcept
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
450 if (pdispVal != NULL)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
471 assert(pSrc != NULL);
-
-
-
474 const HRESULT hr = SafeArrayCopy(
const_cast<LPSAFEARRAY
>(pSrc), &pCopy);
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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);
-
478 SafeArrayGetVartype(
const_cast<LPSAFEARRAY
>(pSrc), &vt);
-
-
-
+
+
479 const HRESULT hr = SafeArrayCopy(
const_cast<LPSAFEARRAY
>(pSrc), &pCopy);
+
+
-
-
-
-
-
-
-
-
496 if (
this != &varSrc) {
-
497 const HRESULT hr = VariantCopy(
this, &varSrc);
-
-
-
-
-
-
-
-
-
509 if (
this != &varSrc) {
-
-
511 memcpy(
this, &varSrc,
sizeof(VARIANT));
-
512 varSrc.vt = VT_EMPTY;
-
-
-
-
-
-
-
-
-
-
-
526 boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
708 bstrVal = SysAllocString(lpszSrc);
-
-
-
-
-
-
-
-
-
720 if (pdispVal != NULL)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
743 if (vt != (VT_UI1|VT_BYREF)) {
-
-
745 vt = VT_UI1|VT_BYREF;
-
-
-
-
-
-
-
-
756 if (vt != (VT_I2|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
769 if (vt != (VT_UI2|VT_BYREF)) {
-
-
771 vt = VT_UI2|VT_BYREF;
-
-
-
-
-
-
-
-
782 if (vt != (VT_I4|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
795 if (vt != (VT_UI4|VT_BYREF)) {
-
-
797 vt = VT_UI4|VT_BYREF;
-
-
-
-
-
-
-
-
808 if (vt != (VT_I4|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
821 if (vt != (VT_UI4|VT_BYREF)) {
-
-
823 vt = VT_UI4|VT_BYREF;
-
-
-
-
-
-
-
-
834 if (vt != (VT_I8|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
847 if (vt != (VT_UI8|VT_BYREF)) {
-
-
849 vt = VT_UI8|VT_BYREF;
-
-
-
-
-
-
-
-
860 if (vt != (VT_R4|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
873 if (vt != (VT_R8|VT_BYREF)) {
-
-
-
-
-
-
-
-
-
-
886 assert(pSrc != NULL);
-
-
-
-
890 const HRESULT hr = SafeArrayCopy(
const_cast<LPSAFEARRAY
>(pSrc), &pCopy);
-
-
892 SafeArrayGetVartype(
const_cast<LPSAFEARRAY
>(pSrc), &vt);
-
-
-
-
-
-
-
-
-
-
-
-
912 if (vt == VT_NULL && varSrc.vt == VT_NULL)
return true;
-
913 if (vt != varSrc.vt)
return false;
-
914 return compare(
static_cast<const VARIANT&
>(*
this), varSrc, LOCALE_USER_DEFAULT, 0) ==
static_cast<HRESULT
>(VARCMP_EQ);
-
-
-
-
-
-
-
-
938 bool operator<(_In_
const VARIANT& varSrc)
const noexcept
-
-
940 if (vt == VT_NULL && varSrc.vt == VT_NULL)
return false;
-
941 return compare(
static_cast<const VARIANT&
>(*
this), varSrc, LOCALE_USER_DEFAULT, 0)==
static_cast<HRESULT
>(VARCMP_LT);
-
-
-
952 bool operator>(_In_
const VARIANT& varSrc)
const noexcept
-
-
954 if (vt == VT_NULL && varSrc.vt == VT_NULL)
return false;
-
955 return compare(
static_cast<const VARIANT&
>(*
this), varSrc, LOCALE_USER_DEFAULT, 0)==
static_cast<HRESULT
>(VARCMP_GT);
-
-
-
-
-
-
-
-
-
-
-
-
-
989 HRESULT
change_type(_In_ VARTYPE _vt, _In_opt_ USHORT wFlags = 0) noexcept
-
-
991 return VariantChangeType(
this,
this, wFlags, _vt);
-
-
-
-
996 HRESULT compare(_In_
const VARIANT &varLeft, _In_
const VARIANT &varRight, _In_ LCID lcid, _In_ ULONG dwFlags)
const noexcept
-
-
-
999 case VT_I1:
return varLeft.cVal == varRight.cVal ? VARCMP_EQ : varLeft.cVal > varRight.cVal ? VARCMP_GT : VARCMP_LT;
-
1000 case VT_UI2:
return varLeft.uiVal == varRight.uiVal ? VARCMP_EQ : varLeft.uiVal > varRight.uiVal ? VARCMP_GT : VARCMP_LT;
-
1001 case VT_UI4:
return varLeft.uintVal == varRight.uintVal ? VARCMP_EQ : varLeft.uintVal > varRight.uintVal ? VARCMP_GT : VARCMP_LT;
-
1002 case VT_UI8:
return varLeft.ullVal == varRight.ullVal ? VARCMP_EQ : varLeft.ullVal > varRight.ullVal ? VARCMP_GT : VARCMP_LT;
-
1003 default:
return VarCmp(
const_cast<LPVARIANT
>(&varLeft),
const_cast<LPVARIANT
>(&varRight), lcid, dwFlags);
-
-
-
-
1008 #pragma warning(pop)
-
-
-
-
-
-
-
-
-
-
1026 m_result = CoInitialize(pvReserved);
-
-
-
-
-
1036 m_result = CoInitializeEx(pvReserved, dwCoInit);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
1076static _Check_return_ HRESULT CoCreateInstance(_In_ REFCLSID rclsid, _In_opt_ LPUNKNOWN pUnkOuter, _In_ DWORD dwClsContext, _Inout_
winstd::com_obj<T> &v)
-
-
-
1079 HRESULT hr = CoCreateInstance(rclsid, pUnkOuter, dwClsContext, __uuidof(T), (LPVOID*)&ppv);
-
-
-
-
-
-
BSTR string wrapper.
Definition: COM.h:180
-
bstr(LPCOLESTR src) noexcept
Constructs BSTR from OLE string.
Definition: COM.h:187
-
virtual ~bstr()
Destroys the string.
Definition: COM.h:214
-
handle_type duplicate_internal(handle_type h) const noexcept override
Duplicates the string.
Definition: COM.h:250
-
bstr(const std::basic_string< wchar_t, _Traits, _Ax > &src) noexcept
Constructs BSTR from std::basic_string.
Definition: COM.h:204
-
bstr(LPCOLESTR src, UINT len) noexcept
Constructs BSTR from OLE string with length.
Definition: COM.h:195
-
void free_internal() noexcept override
Destroys the string.
Definition: COM.h:236
-
UINT length() const noexcept
Returns the length of the string.
Definition: COM.h:225
-
Context scope automatic COM (un)initialization.
Definition: COM.h:1014
-
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:1034
-
com_initializer(LPVOID pvReserved) noexcept
Initializes the COM library on the current thread and identifies the concurrency model as single-thre...
Definition: COM.h:1024
-
HRESULT status() const noexcept
Return result of CoInitialize() call.
Definition: COM.h:1055
-
virtual ~com_initializer()
Uninitializes COM.
Definition: COM.h:1044
-
HRESULT m_result
Result of CoInitialize call.
Definition: COM.h:1061
-
COM object wrapper template.
Definition: COM.h:84
-
void free_internal() noexcept override
Releases the object by decrementing reference counter.
Definition: COM.h:155
-
handle_type duplicate_internal(handle_type h) const noexcept override
Duplicates the object by incrementing the reference counter.
Definition: COM.h:169
-
HRESULT query_interface(_Other **h) const
Queries the object for another interface.
Definition: COM.h:126
-
HRESULT query_interface(com_obj< _Other > &h) const
Queries the object for another interface.
Definition: COM.h:139
-
virtual ~com_obj()
Releases object.
Definition: COM.h:114
-
com_obj(_Other *other)
Queries the object for another interface and creates new class with it.
Definition: COM.h:94
-
com_obj(com_obj< _Other > &other)
Queries the object for another interface and creates new class with it.
Definition: COM.h:106
-
COM runtime error.
Definition: COM.h:24
-
com_runtime_error(error_type num, const std::string &msg)
Constructs an exception.
Definition: COM.h:32
-
com_runtime_error(error_type num, const char *msg=nullptr)
Constructs an exception.
Definition: COM.h:42
-
Base abstract template class to support object handle keeping for objects that support trivial handle...
Definition: Common.h:865
-
T * handle_type
Datatype of the object handle this template class handles.
Definition: Common.h:608
-
handle_type m_h
Object handle.
Definition: Common.h:854
-
Numerical runtime error.
Definition: Common.h:1002
-
HRESULT error_type
Error number type.
Definition: Common.h:1004
-
VARIANT struct wrapper.
Definition: COM.h:262
-
bool operator<=(const VARIANT &varSrc) const noexcept
Is variant less than or equal to?
Definition: COM.h:966
-
variant(bool bSrc) noexcept
Constructs VARIANT from bool.
Definition: COM.h:296
-
variant & operator=(unsigned int nSrc) noexcept
Copy from unsigned int value.
Definition: COM.h:598
-
variant & operator=(unsigned long nSrc) noexcept
Copy from unsigned long value.
Definition: COM.h:624
-
variant(float fltSrc) noexcept
Constructs VARIANT from float.
Definition: COM.h:380
-
variant(VARIANT &&varSrc) noexcept
Moves VARIANT from another.
Definition: COM.h:287
-
variant & operator=(float fltSrc) noexcept
Copy from float value.
Definition: COM.h:664
-
variant & operator=(float *pfSrc) noexcept
Copy from float reference.
Definition: COM.h:858
-
variant(IDispatch *pSrc)
Constructs VARIANT from IDispatch.
Definition: COM.h:445
-
variant(int nSrc, VARTYPE vtSrc=VT_I4) noexcept
Constructs VARIANT from integer.
Definition: COM.h:341
-
variant(const SAFEARRAY *pSrc)
Constructs VARIANT from SAFEARRAY.
Definition: COM.h:469
-
variant & operator=(double *pfSrc) noexcept
Copy from double reference.
Definition: COM.h:871
-
variant & operator=(int *pnSrc) noexcept
Copy from int reference.
Definition: COM.h:780
-
bool operator>(const VARIANT &varSrc) const noexcept
Is variant greater than?
Definition: COM.h:952
-
variant & operator=(bool bSrc) noexcept
Copy from bool value.
Definition: COM.h:520
-
variant & operator=(long nSrc) noexcept
Copy from long value.
Definition: COM.h:611
-
variant & operator=(const SAFEARRAY *pSrc) noexcept
Copy from SAFEARRAY.
Definition: COM.h:884
-
HRESULT change_type(VARTYPE _vt, USHORT wFlags=0) noexcept
Converts a variant from one type to another.
Definition: COM.h:989
-
variant & operator=(IUnknown *pSrc)
Copy from IUnknown.
Definition: COM.h:728
-
variant & operator=(short nSrc) noexcept
Copy from short value.
Definition: COM.h:559
-
variant & operator=(unsigned char *pbSrc) noexcept
Copy from unsigned char reference.
Definition: COM.h:741
-
variant & operator=(unsigned short nSrc) noexcept
Copy from unsigned short value.
Definition: COM.h:572
-
variant & operator=(unsigned char nSrc) noexcept
Copy from unsigned char value.
Definition: COM.h:546
-
variant & operator=(char cSrc) noexcept
Copy from char value.
Definition: COM.h:533
-
variant(LPCOLESTR lpszSrc) noexcept
Constructs VARIANT from OLE string.
Definition: COM.h:427
-
virtual ~variant()
Destroys VARIANT.
Definition: COM.h:486
-
variant(const VARIANT &varSrc)
Constructs VARIANT from another.
Definition: COM.h:275
-
variant(unsigned char nSrc) noexcept
Constructs VARIANT from byte.
Definition: COM.h:314
-
variant & operator=(double dblSrc) noexcept
Copy from double value.
Definition: COM.h:677
-
bool operator!=(const VARIANT &varSrc) const noexcept
Is variant not equal to?
Definition: COM.h:925
-
variant & operator=(int nSrc) noexcept
Copy from int value.
Definition: COM.h:585
-
variant(unsigned long nSrc) noexcept
Constructs VARIANT from unsigned long.
Definition: COM.h:371
-
bool operator==(const VARIANT &varSrc) const noexcept
Is variant equal to?
Definition: COM.h:910
-
variant(IUnknown *pSrc)
Constructs VARIANT from IUnknown.
Definition: COM.h:457
-
variant(unsigned int nSrc, VARTYPE vtSrc=VT_UI4) noexcept
Constructs VARIANT from unsigned integer.
Definition: COM.h:351
-
variant & operator=(CY cySrc) noexcept
Copy from CY value.
Definition: COM.h:690
-
variant & operator=(LPCOLESTR lpszSrc) noexcept
Copy from OLE string value.
Definition: COM.h:704
-
variant(long long nSrc) noexcept
Constructs VARIANT from 64-bit integer.
Definition: COM.h:399
-
variant & operator=(unsigned int *pnSrc) noexcept
Copy from unsigned int reference.
Definition: COM.h:793
-
variant(long nSrc, VARTYPE vtSrc=VT_I4) noexcept
Constructs VARIANT from long.
Definition: COM.h:361
-
variant & operator=(long *pnSrc) noexcept
Copy from long reference.
Definition: COM.h:806
-
variant(unsigned short nSrc) noexcept
Constructs VARIANT from unsigned short.
Definition: COM.h:332
-
bool operator>=(const VARIANT &varSrc) const noexcept
Is variant greater than or equal to?
Definition: COM.h:979
-
variant & operator=(short *pnSrc) noexcept
Copy from short reference.
Definition: COM.h:754
-
variant() noexcept
Constructs blank VARIANT.
Definition: COM.h:267
-
bool operator<(const VARIANT &varSrc) const noexcept
Is variant less than?
Definition: COM.h:938
-
variant(unsigned long long nSrc) noexcept
Constructs VARIANT from unsigned integer.
Definition: COM.h:408
-
variant(char cSrc) noexcept
Constructs VARIANT from character.
Definition: COM.h:305
-
variant & operator=(unsigned short *pnSrc) noexcept
Copy from unsigned short reference.
Definition: COM.h:767
-
variant & operator=(long long *pnSrc) noexcept
Copy from long long reference.
Definition: COM.h:832
-
variant(BSTR bstr) noexcept
Constructs VARIANT from BSTR.
Definition: COM.h:436
-
variant & operator=(unsigned long long *pnSrc) noexcept
Copy from unsigned long long reference.
Definition: COM.h:845
-
variant(double dblSrc, VARTYPE vtSrc=VT_R8) noexcept
Constructs VARIANT from double or variant date.
Definition: COM.h:389
-
variant(short nSrc) noexcept
Constructs VARIANT from short.
Definition: COM.h:323
-
variant(CY cySrc) noexcept
Constructs VARIANT from CY (64-bit integer)
Definition: COM.h:417
-
variant & operator=(unsigned long long nSrc) noexcept
Copy from unsigned long long value.
Definition: COM.h:650
-
variant & operator=(VARIANT &&varSrc) noexcept
Moves from another VARIANT.
Definition: COM.h:507
-
variant & operator=(long long nSrc) noexcept
Copy from long long value.
Definition: COM.h:637
-
variant & operator=(IDispatch *pSrc)
Copy from IDispatch.
Definition: COM.h:715
-
variant & operator=(unsigned long *pnSrc) noexcept
Copy from unsigned long reference.
Definition: COM.h:819
-
variant & operator=(const VARIANT &varSrc)
Copy from another VARIANT.
Definition: COM.h:494
-
#define WINSTD_NONCOPYABLE(C)
Declares a class as non-copyable.
Definition: Common.h:52
-
#define WINSTD_NONMOVABLE(C)
Declares a class as non-movable.
Definition: Common.h:60
-
#define WINSTD_DPLHANDLE_IMPL(C, INVAL)
Implements default constructors and operators to prevent their auto-generation by compiler.
Definition: Common.h:173
-
static const T * invalid
Invalid handle value.
Definition: Common.h:613
-
Deleter for unique_ptr using CoTaskMemFree.
Definition: COM.h:59
-
void operator()(_T *_Ptr) const
Delete a pointer.
Definition: COM.h:71
-
CoTaskMemFree_delete() noexcept
Default constructor.
Definition: COM.h:63
+
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);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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