IContextNode::GetType 方法

检索 IContextNode 对象的类型。

语法

HRESULT GetType(
  [out] GUID *pContextNodeType
);

parameters

pContextNodeType [out]

IContextNode 对象的类型。

返回值

有关返回值的说明,请参阅 类和接口 - 墨迹分析

备注

上下文节点类型常量中介绍了 节点类型

示例

以下示例演示一个帮助程序方法,该方法检索有关指定节点及其 pContextNode 参数的信息。 此帮助程序方法从以下方法返回信息。

// Helper method for collecting information about a context node.
HRESULT CMyClass::GetNodeInformation(
    IContextNode *pContextNode,
    GUID *pNodeIdentifier,
    GUID *pContextNodeType,
    IAnalysisRegion **ppAnalysisRegion,
    IContextNode **ppParentNode,
    IContextNodes **ppSubNodes)
{
    // Get the identifier of the context node.
    HRESULT hr = pContextNode->GetId(pNodeIdentifier);

    if (FAILED(hr))
    {
        return hr;
    }

    // Get the type identifier for the context node.
    hr = pContextNode->GetType(pContextNodeType);

    if (FAILED(hr))
    {
        return hr;
    }

    // Get the location of the context node.
    hr = pContextNode->GetLocation(ppAnalysisRegion);

    if (FAILED(hr))
    {
        return hr;
    }

    // Get the parent node of the context node.
    hr = pContextNode->GetParentNode(ppParentNode);

    if (FAILED(hr))
    {
        if ((*ppAnalysisRegion) != NULL)
        {
            (*ppAnalysisRegion)->Release();
            (*ppAnalysisRegion) = NULL;
        }
        return hr;
    }

    // Get the subnodes of the context node.
    hr = pContextNode->GetSubNodes(ppSubNodes);

    if (FAILED(hr))
    {
        if (*ppAnalysisRegion)
        {
            (*ppAnalysisRegion)->Release();
            (*ppAnalysisRegion) = NULL;
        }
        if (*ppParentNode)
        {
            (*ppParentNode)->Release();
            (*ppParentNode) = NULL;
        }
        return hr;
    }

    return hr;
}

要求

要求
最低受支持的客户端
Windows XP Tablet PC Edition [仅限桌面应用]
最低受支持的服务器
无受支持的版本
标头
IACom.h (还需要 IACom_i.c)
DLL
IACom.dll

另请参阅

IContextNode

上下文节点类型

墨迹分析参考