(dbgmodel.h) 的 IDebugHostType::GetBaseType 方法

如果類型是另一個單一類型的衍生專案 (例如:因為 MyStruct * 衍生自 MyStruct') ,GetBaseType 方法會傳回衍生的基底類型。 對於指標,這會傳回指向的類型。 對於陣列,這會傳回數位的陣列。 如果類型不是這類衍生類型,則會傳回錯誤。

請注意,這個方法與 C++ (或其他語言) 基類無關。 這類符號 (IDebugHostBaseClass) ,可透過對 EnumerateChildren 方法的呼叫從衍生類別列舉。

語法

HRESULT GetBaseType(
  IDebugHostType **baseType
);

參數

baseType

此類型衍生自 的類型會在這裡傳回。 這是指向的類型、數位包含的類型等等...

傳回值

這個方法會傳回表示成功或失敗的 HRESULT。

備註

範例程式碼

ComPtr<IDebugHostType> spType; /* get a type (see FindTypeByName) */

ComPtr<IDebugHostType> spBaseType;
if (SUCCEEDED(spType->GetBaseType(&spBaseType)))
{
    // spBaseType is the base type.
    //     For a pointer, this is the type pointed to
    //     For an array, this is the type which the array contains
    //     etc...
}

規格需求

需求
標頭 dbgmodel.h

另請參閱

IDebugHostType 介面