(dbgmodel.h) 的 IDebugHostField::GetValue 方法

對於在符號資訊內定義的常數值的欄位 (,例如:位置種類指出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 介面