IDiaSymbol::get_value

Retrieves the value of a constant.

HRESULT get_value ( 
   VARIANT* pRetVal
);

Parameters

  • pRetVal
    [in, out] A VARIANT object that is filled in with the value of a constant.

Return Value

If successful, returns S_OK; otherwise, returns S_FALSE or an error code.

Note

A return value of S_FALSE means the property is not available for the symbol.

Remarks

The supplied VARIANT must be initialized before it is passed to this method. For more information, see the example.

Example

void ProcessValue(IDiaSymbol *pSymbol)
{
    VARIANT value;
    value.vt = VT_EMPTY;    // Initialize variant for use.
    if (pSymbol->get_value(&value) == S_OK)
    {
        // Do something with value.
    }
}

//----------------------------------------------------
// Alternate approach
void ProcessValue2(IDiaSymbol *pSymbol)
{
    CComVariant value;
    if (pSymbol->get_value(&value) == S_OK)
    {
        // Do something with value
    }
}

See Also

Reference

IDiaSymbol