IAnalysisWarning::GetNodeIds 方法
返回与此警告关联的任何相关上下文节点的标识符。
语法
HRESULT GetNodeIds(
[in, out] ULONG *pulCount,
[out] GUID **ppNodeIds
);
参数
-
pulCount [in, out]
-
ppNodeIds 中) (GUID 的全局唯一标识符数。
-
ppNodeIds [out]
-
指向标识与此分析警告关联的上下文节点的 GUID 数组的指针;如果没有上下文节点与此警告关联,则为 NULL 。
返回值
有关返回值的说明,请参阅 类和接口 - 墨迹分析。
备注
如果将 ppNodeIds 传递为 NULL, 则 GetNodeIds 方法将返回 S_OK ,并在 pulCount 中返回矩形数。
注意
若要避免内存泄漏,请在不再需要信息时使用 CoTaskMemFree 从 *ppNodeIds 释放内存。
示例
以下示例演示如何获取 IAnalysisWarning 中的 IContextNode 对象,warning
以及如何仅获取 IContextNode 对象的数量
// Get the count of the context nodes and their identifiers.
ULONG count = 0;
GUID* nodeIds = 0;
warning->GetNodeIds(&count, &nodeIds);
// Use nodeIds
::CoTaskMemFree(nodeIds);
// GetNodeIds just gets the count and returns S_OK
ULONG number = 0;
warning->GetNodeIds(&number, NULL);
要求
要求 | 值 |
---|---|
最低受支持的客户端 |
Windows XP Tablet PC Edition [仅限桌面应用] |
最低受支持的服务器 |
无受支持的版本 |
标头 |
|
DLL |
|