# CValue::ValueField Union Reference

`#include <xsi_value.h>`

List of all members.

## Public Attributes
short | sval
LONG | lval
float | fval
double | dval
bool | bval
wchar_t * | pwval
siPtrType | pval
signed char | cval
unsigned char | ucval
CValueArray * | paval
CLongArray * | plaval
CFloatArray * | pfaval
unsigned short | usval
ULONG | ulval
MATH::CVector2f * | pv2f
MATH::CVector3f * | pv3f
MATH::CVector4f * | pv4f
MATH::CQuaternionf * | pqf
MATH::CRotationf * | prf
MATH::CMatrix3f * | pm3f
MATH::CMatrix4f * | pm4f
MATH::CColor4f * | pc4f
MATH::CShape * | pshp
LLONG | llval
ULLONG | ullval

## Detailed Description

This union is used for storing the value described by the CValue::m_t data member. Instead of accessing the value stored in CValue::m_u directly, it is strongly recommended to use the extractor methods defined by CValue.

Example:
  Demonstrates the CValue extractor methods

              CValue val((short)255);

              // good but not recommended
              short wrong = val.sval;

              // right way to do it
              short good = (short)val;

              CComAPIHandler uitoolkit;
              uitoolkit.CreateInstance( L"XSI.UIToolkit");

              CValue dispVal = uitoolkit.GetRef();

              // wrong way of accessing a COM object from a CValue, could return
              // an invalid pointer
              IDispatch* pDisp = dispVal.pval;

              // this is the right way to do it
              IDispatch* pDisp = (IDispatch*)(CValue::siPtrType)dispVal;

## Member Data Documentation

short sval

2 bytes signed integer number value (-32768..32767)

LONG lval

4 bytes signed integer number value (-2147483648..2147483647)

float fval

float value

double dval

double value

bool bval

bool value

wchar_t* pwval

CString value

siPtrType pval

pointer value

signed char cval

byte value

unsigned char ucval

unsigned byte value

CValueArray* paval

Array value

CLongArray* plaval

Long Array value

CFloatArray* pfaval

Float Array value

unsigned short usval

2 bytes unsigned integer number value (0..65535)

ULONG ulval

4 bytes unsigned integer number value (0..4294967295)

MATH::CVector2f* pv2f

CVector2f pointer

MATH::CVector3f* pv3f

CVector3f pointer

MATH::CVector4f* pv4f

CVector4f pointer

MATH::CQuaternionf* pqf

CQuaternionf pointer

MATH::CRotationf* prf

CRotationf pointer

MATH::CMatrix3f* pm3f

CMatrix3f pointer

MATH::CMatrix4f* pm4f

CMatrix4f pointer

MATH::CColor4f* pc4f

CColor4f pointer

MATH::CShape* pshp

CShape pointer

LLONG llval

8 bytes signed integer number type (-9223372036854775808..9223372036854775807)

ULLONG ullval

8 bytes unsigned integer number type (0..18446744073709551615)

The documentation for this union was generated from the following file:

- xsi_value.h