Bagikan melalui


Metode IContextNode::GetId

Mengambil pengidentifikasi untuk objek IContextNode .

Sintaks

HRESULT GetId(
  [out] GUID *pId
);

Parameter

pId [out]

Pengidentifikasi untuk objek IContextNode .

Menampilkan nilai

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

Keterangan

Penganalisis tinta menetapkan pengidentifikasi unik untuk semua simpul konteks yang dibuatnya. Selama analisis tinta, penganalisis tinta dapat mengubah pengidentifikasi untuk simpul konteks. Misalnya, penganalisis tinta dapat mengklasifikasi ulang satu simpul kata sebagai dua simpul kata lalu menetapkan pengidentifikasi asli ke satu dan pengidentifikasi baru ke yang lain. Atau, penganalisis tinta dapat mengklasifikasi ulang dua simpul kata sebagai satu simpul kata dan menetapkan salah satu pengidentifikasi asli ke simpul kata baru.

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

Referensi Analisis Tinta