如果类型是另一种单一类型的派生类型(例如:作为 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 |