IDebugHostConstant::GetValue 方法 (dbgmodel.h)

GetValue 方法返回打包到 VARIANT 中的常量的值。

请务必注意,IDebugHostSymbol 上的 GetType 方法可能会返回常量的特定类型符号。 在这种情况下,不能保证类型符号定义的常量值的打包与此处 GetValue 方法返回的打包相同。

语法

HRESULT GetValue(
  VARIANT *value
);

参数

value

此处将返回打包到 VARIANT 中的数据的值。

返回值

此方法返回指示成功或失败的 HRESULT。

言论

示例代码

ComPtr<IDebugHostConstant> spConstant; /* get a constant */

VARIANT vtValue;
if (SUCCEEDED(spConstant->GetValue(&vtValue)))
{
    // vtValue contains the value of the constant.  The variant type of vtValue 
    // may not match what the type indicates if you get the type of the symbol.
    VariantClear(&vtValue);
}

要求

要求 价值
标头 dbgmodel.h

另请参阅

IDebugHostConstant 接口