IDebugHostType::GetBaseType 方法 (dbgmodel.h)
如果類型是另一個單一類型的衍生專案(例如: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 |