本文整理汇总了C++中CComPtr::AddExtensionRule方法的典型用法代码示例。如果您正苦于以下问题:C++ CComPtr::AddExtensionRule方法的具体用法?C++ CComPtr::AddExtensionRule怎么用?C++ CComPtr::AddExtensionRule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComPtr
的用法示例。
在下文中一共展示了CComPtr::AddExtensionRule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnWizardNext
LRESULT CAddExtnConfirmPage::OnWizardNext(void)
{
CAddExtnWizardSheet* pSheet = (CAddExtnWizardSheet*) GetParent();
const CArray<CString, LPCTSTR>& saSelectedExtns = pSheet->GetSelectedExtensions();
// keep track of the number of rules added
int nRulesAdded = 0;
CComPtr<INeverCompressRules> pNeverRules;
if (pSheet->GetNeverRules(&pNeverRules) == true && pNeverRules != NULL)
{
for (int i = 0; i < saSelectedExtns.GetCount(); i++)
{
CStringA sExtn(saSelectedExtns[i]);
HRESULT hr = pNeverRules->AddExtensionRule(sExtn, "", "", pSheet->GetUpdateCookie());
if (hr == S_OK)
nRulesAdded++;
}
}
if (nRulesAdded > 0)
{
// we need to reset the compression cache since the config has changed
CIISxpressTrayPropertySheet::ResetResponseCache();
}
return 0;
}