Help Center

DVARIANT.PutBuffermethod

Initializes DVARIANT with the contents of a buffer.

COMmethodDVARIANT.INCdocumented

Syntax

FUNCTION PutBuffer (BYVAL pv AS VOID PTR, BYVAL cb AS UINT) AS HRESULT

Parameters

NameDescription
pvPointer to the source buffer.
cbThe length of the buffer, in bytes.

Return value

If this function succeeds, it returns S_OK (0). Otherwise, it returns an HRESULT error code.

Description

Initializes DVARIANT with the contents of a buffer.

Remarks

Creates a VT_ARRAY OR VT_UI1 variant.

Example

DIM dv AS DVARIANT DIM strIn AS STRING = "Test string" dv.PutBuffer(STRPTR(strIn), LEN(strIn))

DIM nBytes AS LONG = dv.GetElementCount DIM strOut AS STRING = SPACE(nBytes) dv.ToBuffer(STRPTR(strOut), nBytes) PRINT strOut

Reference

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