ICoNtextNode::GetId 方法
擷取 ICoNtextNode 物件的識別碼。
語法
HRESULT GetId(
[out] GUID *pId
);
參數
-
pId [out]
-
ICoNtextNode物件的識別碼。
傳回值
如需傳回值的描述,請參閱 類別和介面 - 筆跡分析。
備註
筆跡分析器會將唯一識別碼指派給它建立的所有內容節點。 在筆跡分析期間,筆跡分析器可能會變更內容節點的識別碼。 例如,筆跡分析器可能會將一個位元組點重新分類為兩個位元組點,然後將原始識別碼指派給其中一個,並將新的識別碼指派給另一個。 或者,筆跡分析器可能會將兩個位元組點重新分類為一個位元組點,並將其中一個原始識別碼指派給新的單位元組點。
範例
下列範例顯示可擷取指定節點及其 pCoNtextNode 參數相關資訊的協助程式方法。 這個協助程式方法會從下列方法傳回信息。
- 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;
}
規格需求
需求 | 值 |
---|---|
最低支援的用戶端 |
Windows XP Tablet PC Edition [僅限傳統型應用程式] |
最低支援的伺服器 |
都不支援 |
標頭 |
|
DLL |
|