IContextNode::GetLocation-Methode

Ruft die Position und Größe des IContextNode-Objekts ab.

Syntax

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

Parameter

ppIAnalysisRegion [out]

Ein Zeiger auf die Position und Größe des IContextNode-Objekts .

Rückgabewert

Eine Beschreibung der Rückgabewerte finden Sie unter Klassen und Schnittstellen – Freihandanalyse.

Bemerkungen

Achtung

Um einen Speicherverlust zu vermeiden, rufen Sie IUnknown::Release auf *ppIAnalysisRegion auf, wenn Sie die Analyseregion nicht mehr verwenden müssen.

Der Standort für einen Containerknoten wird durch Die Suche nach der Union aller Blattstandorte bestimmt. Die Position für einen Freihandblattknoten wird bestimmt, indem die Union des umgebenden Felds der zugeordneten Striche ermittelt wird. Der Speicherort für einen Knoten ohne Freihandblatt wird beim Erstellen des Knotens festgelegt und kann mithilfe von IContextNode::SetLocation aktualisiert werden.

Beispiele

Das folgende Beispiel zeigt eine Hilfsmethode, die Informationen zu einem angegebenen Knoten, dem pContextNode-Parameter, abruft . Diese Hilfsmethode gibt Informationen aus den folgenden Methoden zurück.

// 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;
}

Anforderungen

Anforderung Wert
Unterstützte Mindestversion (Client)
Windows XP Tablet PC Edition [nur Desktop-Apps]
Unterstützte Mindestversion (Server)
Nicht unterstützt
Header
IACom.h (erfordert auch IACom_i.c)
DLL
IACom.dll

Siehe auch

IContextNode

IAnalysisRegion

IContextNode::SetLocation

Freihandanalysereferenz