IDebugHostType::GetPointerKind 方法 (dbgmodel.h)

对于指针类型,GetPointerKind 方法返回指针的类型。 这由 PointerKind 枚举定义,是以下值之一:

枚举 意义
PointerStandard 指示标准 C/C++ 指针 -- a *
PointerReference 指示 C/C++ 引用 (是否常数) - &
PointerRValueReference 指示 C/C++右值引用 (无论是否常数) - &&
PointerCXHat 指示 C++/CX hat 托管指针(无论是否常数)-- ^

语法

HRESULT GetPointerKind(
  PointerKind *pointerKind
);

参数

pointerKind

此处将返回指针类型(作为 PointerKind 枚举中的值)。

返回值

此方法返回指示成功或失败的 HRESULT。

言论

示例代码

ComPtr<IDebugHostType> spType; /* get a type for something that's a pointer 
                                  or reference (see FindTypeByName) */

PointerKind pk;
if (SUCCEEDED(spType->GetPointerKind(&pk)))
{
    // pk indicates the kind of pointer:
    //      PointerStandard (it's a '*')
    //      PointerReference (it's a '&')
    //      etc...
}

要求

要求 价值
标头 dbgmodel.h

另请参阅

IDebugHostType 接口