1 Star 0 Fork 1

nkjpj/PaintPlus-1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CommandHandler.h 1.82 KB
一键复制 编辑 原始数据 按行查看 历史
ngtritham 提交于 2017-12-06 23:09 . Initial commit
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// This interface should be returned by the application during command creation.
// For the purpose of this sample, it has a barebone implementation.
// Also the same command handler is returned for every command.
//
#pragma once
// This is a generic command handler used by every command in this sample.
//
// CLASS: CCommandHandler : IUICommandHandler
//
// PURPOSE: Implements interface IUICommandHandler.
//
// COMMENTS:
//
// This is a generic command handler used by every command in this sample.
// IUICommandHandler should be returned by the application during command creation.
// For the purpose of this sample, it has a barebone implementation.
// Also the same command handler is returned for every command.
//
class CCommandHandler : public IUICommandHandler // Command handlers must implement IUICommandHandler.
{
public:
// Static method to create an instance of the object.
static HRESULT CreateInstance(IUICommandHandler **ppCommandHandler);
// IUnknown methods.
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
// IUICommandHandler methods
STDMETHOD(UpdateProperty)(UINT nCmdID,
REFPROPERTYKEY key,
const PROPVARIANT* ppropvarCurrentValue,
PROPVARIANT* ppropvarNewValue);
STDMETHOD(Execute)(UINT nCmdID,
UI_EXECUTIONVERB verb,
const PROPERTYKEY* key,
const PROPVARIANT* ppropvarValue,
IUISimplePropertySet* pCommandExecutionProperties);
private:
CCommandHandler() : m_cRef(1) {}
LONG m_cRef; // Reference count.
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nkjpj/PaintPlus-1.git
git@gitee.com:nkjpj/PaintPlus-1.git
nkjpj
PaintPlus-1
PaintPlus-1
master

搜索帮助