Metode IContextNode::GetType

Mengambil jenis objek IContextNode .

Sintaks

HRESULT GetType(
  [out] GUID *pContextNodeType
);

Parameter

pContextNodeType [out]

Jenis objek IContextNode .

Menampilkan nilai

Untuk deskripsi nilai yang dikembalikan, lihat Kelas dan Antarmuka - Analisis Tinta.

Keterangan

Jenis simpul dijelaskan dalam konstanta Jenis Simpul Konteks .

Contoh

Contoh berikut menunjukkan metode pembantu yang mengambil informasi tentang simpul tertentu, parameter pContextNode-nya . Metode pembantu ini mengembalikan informasi dari metode berikut.

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

Persyaratan

Persyaratan Nilai
Klien minimum yang didukung
Windows XP Tablet PC Edition [hanya aplikasi desktop]
Server minimum yang didukung
Tidak ada yang didukung
Header
IACom.h (juga memerlukan IACom_i.c)
DLL
IACom.dll

Lihat juga

IContextNode

Jenis Simpul Konteks

Referensi Analisis Tinta