本文整理汇总了C++中CNode::GetClassGuid方法的典型用法代码示例。如果您正苦于以下问题:C++ CNode::GetClassGuid方法的具体用法?C++ CNode::GetClassGuid怎么用?C++ CNode::GetClassGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNode
的用法示例。
在下文中一共展示了CNode::GetClassGuid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RecurseFindDevice
HTREEITEM
CDeviceView::RecurseFindDevice(
_In_ HTREEITEM hParentItem,
_In_ CNode *Node
)
{
HTREEITEM FoundItem;
HTREEITEM hItem;
TVITEMW tvItem;
CNode *FoundNode;
// Check if this node has any children
hItem = TreeView_GetChild(m_hTreeView, hParentItem);
if (hItem == NULL) return NULL;
// The lParam contains the node pointer data
tvItem.hItem = hItem;
tvItem.mask = TVIF_PARAM;
if (TreeView_GetItem(m_hTreeView, &tvItem) &&
tvItem.lParam != NULL)
{
// check for a matching node
FoundNode = reinterpret_cast<CNode *>(tvItem.lParam);
if ((FoundNode->GetNodeType() == Node->GetNodeType()) &&
(IsEqualGUID(*FoundNode->GetClassGuid(), *Node->GetClassGuid())))
{
// check if this is a class node, or a device with matching ID's
if ((FoundNode->GetNodeType() == ClassNode) ||
(wcscmp(FoundNode->GetDeviceId(), Node->GetDeviceId()) == 0))
{
return hItem;
}
}
}
// This node may have its own children
FoundItem = RecurseFindDevice(hItem, Node);
if (FoundItem) return FoundItem;
// Loop all the siblings
for (;;)
{
// Get the next item at this level
hItem = TreeView_GetNextSibling(m_hTreeView, hItem);
if (hItem == NULL) break;
// The lParam contains the node pointer data
tvItem.hItem = hItem;
tvItem.mask = TVIF_PARAM;
if (TreeView_GetItem(m_hTreeView, &tvItem))
{
// check for a matching class
FoundNode = reinterpret_cast<CNode *>(tvItem.lParam);
if ((FoundNode->GetNodeType() == Node->GetNodeType()) &&
(IsEqualGUID(*FoundNode->GetClassGuid(), *Node->GetClassGuid())))
{
// check if this is a class node, or a device with matching ID's
if ((FoundNode->GetNodeType() == ClassNode) ||
(wcscmp(FoundNode->GetDeviceId(), Node->GetDeviceId()) == 0))
{
return hItem;
}
}
}
// This node may have its own children
FoundItem = RecurseFindDevice(hItem, Node);
if (FoundItem) return FoundItem;
}
return hItem;
}