Table of Contents

CzVar::SetValue

Description

Set the value of the variable attached to this CzVar object, ensuring first it is of the correct variable type.

Function prototype

bool CzVar::SetValue(long VarID, void* pValue);

Arguments

Name Type Comment
VarID long The expected type ID of the variable.
pValue void* A user-supplied handle to an allocated block of memory for the appropriate data type, containing the value to be set.

Return value

False if:

  1. pValue is null.
  2. The CzVar object is not initialised as a variable of the type given by VarID.
  3. The variable type cannot be copied (see comments for var_GetValue.)

True otherwise.

Comments

This function is equivalent to the API function var_SetValueEx. Please refer to the documentation of that function for additional information.