IContextNode::Metode GetLocation

Mengambil posisi dan ukuran objek IContextNode .

Sintaks

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

Parameter

ppIAnalysisRegion [out]

Penunjuk ke posisi dan ukuran objek IContextNode .

Menampilkan nilai

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

Keterangan

Perhatian

Untuk menghindari kebocoran memori, panggil IUnknown::Release di *ppIAnalysisRegion saat Anda tidak perlu lagi menggunakan wilayah analisis.

Lokasi untuk simpul kontainer ditentukan dengan menemukan penyatuan semua lokasi daun. Lokasi untuk simpul daun tinta ditentukan dengan menemukan penyatuan kotak pembatas goresan terkait. Lokasi untuk simpul daun non-tinta diatur ketika simpul dibuat dan dapat diperbarui menggunakan IContextNode::SetLocation.

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

IAnalysisRegion

IContextNode::SetLocation

Referensi Analisis Tinta