IContextNode::GetId メソッド

IContextNode オブジェクトの識別子を取得します。

構文

HRESULT GetId(
  [out] GUID *pId
);

パラメーター

pId [out]

IContextNode オブジェクトの識別子。

戻り値

戻り値の説明については、「 クラスとインターフェイス - インク分析」を参照してください。

解説

インク アナライザーは、作成するすべてのコンテキスト ノードに一意の識別子を割り当てます。 インク分析中に、インク アナライザーによってコンテキスト ノードの識別子が変更される場合があります。 たとえば、インク アナライザーでは、1 つの単語ノードを 2 つの単語ノードとして再分類し、元の識別子を 1 つに、もう一方に新しい識別子を割り当てることができます。 または、インク アナライザーで 2 つの単語ノードを 1 つの単語ノードとして再分類し、元の識別子の 1 つを新しい単語ノードに割り当てることができます。

次の例は、指定したノードに関する情報を取得するヘルパー メソッドとその 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 [デスクトップ アプリのみ]
サポートされている最小のサーバー
サポートなし
Header
IACom.h (IACom_i.c も必要)
[DLL]
IACom.dll

関連項目

IContextNode

インク分析リファレンス