ICoNtextNode::GetType 方法

擷取 ICoNtextNode 物件的類型。

語法

HRESULT GetType(
  [out] GUID *pContextNodeType
);

參數

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

內容節點類型

筆跡分析參考