Metodo IContextNode::GetType

Recupera il tipo dell'oggetto IContextNode .

Sintassi

HRESULT GetType(
  [out] GUID *pContextNodeType
);

Parametri

pContextNodeType [out]

Tipo dell'oggetto IContextNode .

Valore restituito

Per una descrizione dei valori restituiti, vedere Classi e interfacce - Analisi input penna.

Commenti

I tipi di nodi sono descritti nelle costanti Tipi di nodo di contesto .

Esempio

Nell'esempio seguente viene illustrato un metodo helper che recupera informazioni su un nodo specificato, il relativo parametro pContextNode . Questo metodo helper restituisce informazioni dai metodi seguenti.

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

Requisiti

Requisito Valore
Client minimo supportato
Windows XP Tablet PC Edition [solo app desktop]
Server minimo supportato
Nessuno supportato
Intestazione
IACom.h (richiede anche IACom_i.c)
DLL
IACom.dll

Vedi anche

IContextNode

Tipi di nodo di contesto

Informazioni di riferimento per l'analisi dell'input penna