本文整理汇总了C++中CMyComPtr::SetProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ CMyComPtr::SetProperty方法的具体用法?C++ CMyComPtr::SetProperty怎么用?C++ CMyComPtr::SetProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMyComPtr
的用法示例。
在下文中一共展示了CMyComPtr::SetProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChangeComment
void CPanel::ChangeComment()
{
CPanel::CDisableTimerProcessing disableTimerProcessing2(*this);
int index = _listView.GetFocusedItem();
if (index < 0)
return;
int realIndex = GetRealItemIndex(index);
if (realIndex == kParentIndex)
return;
CSelectedState state;
SaveSelectedState(state);
CMyComPtr<IFolderOperations> folderOperations;
if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
{
MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
return;
}
UString comment;
{
NCOM::CPropVariant propVariant;
if (_folder->GetProperty(realIndex, kpidComment, &propVariant) != S_OK)
return;
if (propVariant.vt == VT_BSTR)
comment = propVariant.bstrVal;
else if (propVariant.vt != VT_EMPTY)
return;
}
UString name = GetItemRelPath(realIndex);
CComboDialog comboDialog;
comboDialog.Title = name + L" " + LangString(IDS_COMMENT, 0x03020290);
comboDialog.Value = comment;
comboDialog.Static = LangString(IDS_COMMENT2, 0x03020291);
if (comboDialog.Create(GetParent()) == IDCANCEL)
return;
NCOM::CPropVariant propVariant = comboDialog.Value;
HRESULT result = folderOperations->SetProperty(realIndex, kpidComment, &propVariant, NULL);
if (result != S_OK)
{
if (result == E_NOINTERFACE)
MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
else
MessageBoxError(result, L"Set Comment Error");
}
RefreshListCtrl(state);
}