ICoNtextNode::GetLocation 方法

擷取 ICoNtextNode 物件的位置和大小。

語法

HRESULT GetLocation(
  [out] IAnalysisRegion **ppIAnalysisRegion
);

參數

ppIAnalysisRegion [out]

ICoNtextNode物件位置和大小的指標。

傳回值

如需傳回值的描述,請參閱 類別和介面 - 筆跡分析

備註

警告

若要避免記憶體流失,當您不再需要流量分析區域時,請在 *ppIAnalysisRegion上呼叫IUnknown::Release

容器節點的位置取決於尋找所有分葉位置的聯集。 筆跡分葉節點的位置取決於尋找相關聯筆劃周框方塊的聯集。 建立節點時,會設定非筆跡分葉節點的位置,而且可以使用 ICoNtextNode::SetLocation進行更新。

範例

下列範例顯示可擷取指定節點及其 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

IAnalysisRegion

ICoNtextNode::SetLocation

筆跡分析參考