IDebugHostField::GetValue 方法 (dbgmodel.h)

对于在符号信息中定义的常量值的字段(例如:其位置类型指示 LocationConstant 的字段),GetValue 方法将返回字段的常量值。

如果给定字段没有常量值,GetValue 方法将失败。

语法

HRESULT GetValue(
  VARIANT *value
);

参数

value

此处将返回打包到 VARIANT 中的字段的值。

返回值

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

言论

示例代码

ComPtr<IDebugHostField> spField; /* get a field (see EnumerateChildren) */

VARIANT vtValue;
if (SUCCEEDED(spField->GetValue(&vtValue)))
{
    // For fields which have a constant value as determined by GetLocationKind, 
    // vtValue will contain the value of the field.
    VariantClear(&vtValue);
}

要求

要求 价值
标头 dbgmodel.h

另请参阅

IDebugHostField 接口