|
VariantCopyInd
pvarDest, pvargSrc)
VARIANT FAR* pvarDest
VARIANTARG FAR* pvargSrc
Frees the destination variant and makes a copy of the source VARIANTARG,
performing the necessary indirection if the source is specified to be VT_BYREF.
Parameters
pvarDest
Pointer to the VARIANTARG to receive the copy.
pvargSrc
Pointer to the VARIANTARG to be copied.
Return Value
The SCODE obtained from the returned HRESULT is one of the following:
SCODE
| Meaning
| S_OK
| Success.
| DISP_E_ARRAYISLOCKED
| The variant contains an array that is locked.
| DISP_E_BADVARTYPE
| The source and destination have an invalid variant type (usually
uninitialized).
| E_OUTOFMEMORY
| Memory could not be allocated for the copy.
| E_INVALIDARG
| The argument pvargSrc was VT_ARRAY.
|
Comments
This function is useful when you need to make a copy of a variant and
guarantee that it is not VT_BYREF, such as when handling arguments in an implementation
of IDispatch::Invoke.
For example, if the source is a (VT_BYREF | VT_I2), the destination will be a
ByVal VT_I2. The same is true for all legal VT_BYREF combinations including
VT_VARIANT.
If pvargSrc is (VT_BYREF | VT_VARIANT) and the contained variant is also VT_BYREF, the
contained variant is also dereferenced.
This function frees any existing contents of pvarDest.
Related LinksSoftware for Delphi and C++ Builder developers Software for Visual Studio .NET developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference (win32.hlp) Win32 Multimedia Programmer's Reference (mmedia.hlp) Microsoft Windows Pen API Programmer's Reference (penapi.hlp) Microsoft Windows Sockets 2 Reference (sock2.hlp) Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp) Unix Manual Pages
|