共用方式為


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 介面