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...
}

要求

要求
Header dbgmodel.h

另请参阅

IDebugHostType 接口