Help Center

AfxDVarToBufferfunction

Extracts the contents of a variant that contains an array of bytes.

COMfunctionDVARIANT.INCdocumented

Syntax

FUNCTION AfxDVarToBuffer (BYREF cvIn AS DVARIANT, BYVAL pv AS LPVOID, BYVAL cb AS ULONG) AS HRESULT

Parameters

NameDescription
cvInReference to the source DVARIANT.
pvPointer to a buffer of length cb bytes. When this function returns, contains the first cb bytes of the extracted buffer value.
cbThe size of the pv buffer, in bytes. The buffer should be the same size as the data to be extracted, or smaller.

Return value

Returns one of the following values:

Description

Extracts the contents of a variant that contains an array of bytes.

Remarks

If you want to call a method that has optional variant parameters, you still have to pass the parameters, but in a way that the methods know that they were omitted. Specifically, you have to pass them as type VT_ERROR, code DISP_E_PARAM_NOT_FOUND.

Examples

FUNCTION AfxDVarOptPrm () AS DVARIANT #define DVAR_OPTPRM AfxDVarOptPrm

DIM v AS VARIANT = TYPE(VT_ERROR, 0, 0, 0, DISP_E_PARAMNOTFOUND)

Reference

  • Include file DVARIANT.INC
  • Defined in AfxNova/DVARIANT.inc:2796
  • Documented in COM/DVARIANT Class.md
  • Topic: DVARIANT Class