WinStd
Windows Win32 API using Standard C++
Loading...
Searching...
No Matches
WinStdCOMHelpers

Functions

VARIANT & operator<< (VARIANT &v, IDispatch *value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const CHAR value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const BYTE value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const SHORT value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const USHORT value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const LONG value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const ULONG value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const LONGLONG value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const ULONGLONG value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const FLOAT value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const DOUBLE value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const BOOL value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, LPCOLESTR value)
 Saves value to VARIANT.
 
template<class _Traits , class _Ax >
VARIANT & operator<< (VARIANT &v, const std::basic_string< OLECHAR, _Traits, _Ax > &value)
 Saves value to VARIANT.
 
VARIANT & operator<< (VARIANT &v, const GUID &value)
 Saves value to VARIANT.
 
VARIANT winstd::BuildVBARRAY (VARTYPE vt, LPCVOID array, ULONG columns, ULONG rows)
 Builds VBARRAY of uniform data.
 
template<class T , ULONG columns = 1>
VARIANT winstd::BuildVBARRAY (const T *array, ULONG rows)
 Builds VBARRAY of uniform data.
 
VARIANT winstd::BuildVBARRAY (HDC dc, HBITMAP pic)
 Builds VBARRAY containing BMP image.
 
template<class T >
void winstd::IDispatchInvoke (T *cp, DISPID id, DISPPARAMS *param, LCID locale=LOCALE_USER_DEFAULT)
 Calls IDispatch::Invoke.
 
template<class T >
winstd::VariantAsInteger (const VARIANT *var, T fallback=0)
 Check VARIANT value for integer value.
 
BOOL winstd::VariantAsBoolean (const VARIANT *var, BOOL fallback=FALSE)
 Check VARIANT value for boolean value.
 

Detailed Description

Function Documentation

◆ BuildVBARRAY() [1/3]

template<class T , ULONG columns = 1>
VARIANT winstd::BuildVBARRAY ( const T * array,
ULONG rows )

Builds VBARRAY of uniform data.

This template is using operator <<(VARIANT&, const T&) to write data to VBARRAY. Such operator must be declared for given datatype T.

Template Parameters
TElement type
columnsNumber of columns. When 1, SafeArrayCreateVector is used; when >1, SafeArrayCreate is used.
Parameters
arrayPointer to data
rowsNumber of rows of data
Returns
Returns VBARRAY

◆ BuildVBARRAY() [2/3]

VARIANT winstd::BuildVBARRAY ( HDC dc,
HBITMAP pic )
inline

Builds VBARRAY containing BMP image.

Parameters
[in]dcDrawing context
[in]rowsBitmap handle
Returns
Returns VBARRAY

◆ BuildVBARRAY() [3/3]

VARIANT winstd::BuildVBARRAY ( VARTYPE vt,
LPCVOID array,
ULONG columns,
ULONG rows )
inline

Builds VBARRAY of uniform data.

Parameters
[in]vtType of array element
[in]arrayPointer to data
[in]columnsNumber of columns. When 1, SafeArrayCreateVector is used; when >1, SafeArrayCreate is used.
[in]rowsNumber of rows
Returns
Returns VBARRAY

◆ IDispatchInvoke()

template<class T >
void winstd::IDispatchInvoke ( T * cp,
DISPID id,
DISPPARAMS * param,
LCID locale = LOCALE_USER_DEFAULT )

Calls IDispatch::Invoke.

Template Parameters
TOriginal interface type
Parameters
[in]cpAny interface of the class that implements IDispatch
[in]idID of method to invoke
[in]paramParameters for the method to invoke
[in]localeLocale for the invoke call

◆ operator<<() [1/15]

VARIANT & operator<< ( VARIANT & v,
const BOOL value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [2/15]

VARIANT & operator<< ( VARIANT & v,
const BYTE value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [3/15]

VARIANT & operator<< ( VARIANT & v,
const CHAR value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [4/15]

VARIANT & operator<< ( VARIANT & v,
const DOUBLE value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [5/15]

VARIANT & operator<< ( VARIANT & v,
const FLOAT value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [6/15]

VARIANT & operator<< ( VARIANT & v,
const GUID & value )
inline

Saves value to VARIANT.

Note
This operator saves GUID as BSTR string in "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" notation.
Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [7/15]

VARIANT & operator<< ( VARIANT & v,
const LONG value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [8/15]

VARIANT & operator<< ( VARIANT & v,
const LONGLONG value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [9/15]

VARIANT & operator<< ( VARIANT & v,
const SHORT value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [10/15]

template<class _Traits , class _Ax >
VARIANT & operator<< ( VARIANT & v,
const std::basic_string< OLECHAR, _Traits, _Ax > & value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [11/15]

VARIANT & operator<< ( VARIANT & v,
const ULONG value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [12/15]

VARIANT & operator<< ( VARIANT & v,
const ULONGLONG value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [13/15]

VARIANT & operator<< ( VARIANT & v,
const USHORT value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [14/15]

VARIANT & operator<< ( VARIANT & v,
IDispatch * value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ operator<<() [15/15]

VARIANT & operator<< ( VARIANT & v,
LPCOLESTR value )
inline

Saves value to VARIANT.

Parameters
[out]vVARIANT to save value to. For performance reasons, no VariantClear is called before saving. Thus, v must not contain referenced data.
[in]valueValue to save
Returns
Reference to VARIANT successor in array of VARIANT(s)

◆ VariantAsBoolean()

BOOL winstd::VariantAsBoolean ( const VARIANT * var,
BOOL fallback = FALSE )
inline

Check VARIANT value for boolean value.

Parameters
[in]varPointer to VARIANT value
[in]fallbackValue to return, for non-boolean and non-numeric VARIANT types.
Returns
TRUE if var is VT_BOOL and not VARIANT_FALSE, or VT_<numeric> and not zero; FALSE if var is VT_BOOL and VARIANT_FALSE, or VT_<numeric> and zero; fallback otherwise.

◆ VariantAsInteger()

template<class T >
T winstd::VariantAsInteger ( const VARIANT * var,
T fallback = 0 )

Check VARIANT value for integer value.

Template Parameters
TIntegral type
Parameters
[in]varPointer to VARIANT value
[in]fallbackValue to return, for non-integral types.
Returns
Value of VARIANT if integral; fallback otherwise.