本文整理汇总了C++中CComQIPtr::GetModule方法的典型用法代码示例。如果您正苦于以下问题:C++ CComQIPtr::GetModule方法的具体用法?C++ CComQIPtr::GetModule怎么用?C++ CComQIPtr::GetModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComQIPtr
的用法示例。
在下文中一共展示了CComQIPtr::GetModule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: item
IModule * CRepositoryView::GetFirstSelectedModule()
{
for(HTREEITEM pos = m_Tree.GetFirstSelectedItem(); pos != (HTREEITEM)0; pos = m_Tree.GetNextSelectedItem(pos))
{
WTL::CTreeItem item(pos, &m_Tree);
CComQIPtr<CModuleNode> node = reinterpret_cast<CTreeNode *>(item.GetData());
if (node)
return node->GetModule();
}
return NULL;
}
示例2: PreTranslateMessage
BOOL CRepositoryView::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN)
{
UINT ctrl = 0;
switch(pMsg->wParam)
{
case VK_DELETE:
DoDeleteSelectedAttributes();
break;
case VK_RETURN:
{
TVITEM item;
item.mask = TVIF_HANDLE;
item.hItem = m_Tree.GetSelectedItem();
if (m_Tree.GetItem(&item))
{
CComPtr<CTreeNode> tn = (CTreeNode *)item.lParam;
tn->OnDblclk(m_Tree.GetSelectedItem());
}
}
break;
case _T('C'):
case _T('c'):
{
ctrl = ::GetKeyState(VK_CONTROL);
UINT alt = ::GetKeyState(VK_MENU);
if (ctrl != 0 && alt != 0)
{
CRepositorySelections s;
GetSelected(s);
if (!s.attrs.empty())
DoCopy(s.attrs, _T("\r\n"));
return 0;
}
}
break;
case VK_F5:
RefreshRepository();
break;
case _T('N'):
case _T('n'):
ctrl = ::GetKeyState(VK_CONTROL);
if (ctrl != 0)
{
TVITEM item;
item.mask = TVIF_HANDLE;
item.hItem = m_Tree.GetSelectedItem();
if (m_Tree.GetItem(&item))
{
CComQIPtr<CModuleNode> modNode = (CTreeNode *)item.lParam;
if (modNode) {
m_Owner->DoInsertAttribute(modNode->GetModule());
}
}
}
break;
default:
break;
}
}
return IsDialogMessage(pMsg);
}