本文整理汇总了C++中LPDISPATCH::AddRef方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDISPATCH::AddRef方法的具体用法?C++ LPDISPATCH::AddRef怎么用?C++ LPDISPATCH::AddRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDISPATCH
的用法示例。
在下文中一共展示了LPDISPATCH::AddRef方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/* Return the button with TAG and assigned to INSPECTOR. TAG must be
given without the suffix. Returns NULL if not found. */
static LPDISPATCH
get_button (LPDISPATCH inspector, const char *tag)
{
LPDISPATCH result = NULL;
inspector_info_t iinfo;
button_list_t ol;
lock_all_inspectors ();
for (iinfo = all_inspectors; iinfo; iinfo = iinfo->next)
if (iinfo->inspector == inspector)
{
for (ol = iinfo->buttons; ol; ol = ol->next)
if (ol->tag && !strcmp (ol->tag, tag))
{
result = ol->button;
if (result)
result->AddRef ();
break;
}
break;
}
unlock_all_inspectors ();
return result;
}
示例2: GetDocument
LPDISPATCH Change::GetDocument()
{
LPDISPATCH lpDisp = NULL;
lpDisp = (LPDISPATCH)m_pDoc->GetInterface(&IID_IDispatch);
if (lpDisp)
lpDisp->AddRef();
return lpDisp;
}