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.
- IContextNode::GetId
- IContextNode::GetType
- IContextNode::GetLocation
- IContextNode::GetParentNode
// 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 |
|
DLL |
|
Lihat juga
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk