vptr

WinFBX

vptr

CVAR Class ››
Parent Previous Next

Description

Clears the CVAR and returns the address of the underlying variant. Can be used to pass the variant to an OUT BYVAL VARIANT PTR parameter. If we pass a CVAR to a function with an OUT variant parameter without first clearing the contents of the CVAR, we may have a memory leak.


Syntax


FUNCTION vptr () AS VARIANT PTR


Parameter


This method has no parameters.


Return value


The address of the underlying variant.


Example


SUB Foo (BYVAL v AS VARIANT PTR)

  v->vt = VT_I4

  v->lVal = 12345

END SUB


DIM cv AS CVAR = "Test string"

Foo cv.vptr

PRINT cv


Otherwise, you need to clear the underlying variant before passing the CVAR.


DIM cv AS CVAR = "Test string"

cv.Clear

Foo *cv

PRINT cv


Include file


CVar.inc


Created with the Personal Edition of HelpNDoc: Easily create EBooks