⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addincommandhandler.h

📁 ResOrg 图形化管理Vc项目的资源ID的工具的源代码。 ResOrg - Manage and Renumber Resource Symbol IDs Introduction The
💻 H
字号:
/************************************************************************
 *
 *            Resource ID Organiser Add-In for Visual C++ .NET
 *
 * (c) Copyright 2000-2005 by Riverblade Limited (UK). All rights reserved.
 *
 ************************************************************************
 *                                                                       
 *  Description : CAddInCommandHandler - Base class for handling
 *                commands in the Visual Studio environment
 *
 *  Compiler    : Microsoft Visual C++ .NET 2003
 *                                                                       
 *  Target                                                               
 *  Environment : Windows 2000/XP/Vista;
 *                Visual Studio 2002, 2003 or 2005
 *
 *  NOTE:
 *
 *    This software is provided "as is". All title and copyrights in and
 *    to the software, including but not limited to any images, text etc.
 *    etc. incorporated into it, are the property of Anna-Jayne Metcalfe
 *    and Riverblade Limited, except where acknowledged otherwise.
 *
 *    Your may freely use this code in your own products, PROVIDED
 *    this notice is not removed or modified.
 *
 *    Please visit http://www.riverblade.co.uk/products/resorg or email 
 *    support@riverblade.co.uk for latest updates and product support 
 *
 ************************************************************************
 *
 *   MODIFICATION HISTORY:
 *
 *           This is a controlled document. See project configuration
 *           control tool for latest version and full version history.
 *
 *    $Archive: /Projects/AddIns/ResOrg/ResOrgNETAddIn/AddInCommandHandler.h $
 *   $Revision: 1 $
 *       $Date: 16/10/05 17:21 $
 *     $Author: Anna $
 *
 *    $History: AddInCommandHandler.h $
 * 
 * *****************  Version 1  *****************
 * User: Anna         Date: 16/10/05   Time: 17:21
 * Created in $/Projects/AddIns/ResOrg/ResOrgNETAddIn
 * 
 * $Nokeywords: $
 *
 ************************************************************************/

#pragma once



/// CAddInCommandHandler is a base class for handling add-in commands in the
/// Visual Studio environment
///
/// To add additional commands derive your own classes from this one
/// and override the QueryStatus() and Execute() methods to implement
/// the command actions required.
///
/// The add-in's CConnect class is responsible for maintaining a map
/// (command name => CAddInCommandHandler pointer) of command handler object
/// and routing QueryStatus() and Execute() calls to the correct one.
///
//lint -save -e1712 (Info -- default constructor not defined for class 'CAddInCommandHandler')
class CAddInCommandHandler
{
	// Construction/destruction
	public:
				CAddInCommandHandler(	const CComPtr<EnvDTE::_DTE>& pDTE,
										const _bstr_t& bsCommandName);

		virtual	~CAddInCommandHandler(void);


	// Data members
	protected:
				CComPtr<EnvDTE::_DTE>	m_pDTE;
				_bstr_t					m_bsCommandName;


	// Operations
	public:
				_bstr_t					GetCommandName(void) const
											{ return m_bsCommandName; }


	// Virtual overrides
	public:
		virtual	HRESULT					QueryStatus(BSTR bstrCmdName,
													EnvDTE::vsCommandStatusTextWanted NeededText,
													EnvDTE::vsCommandStatus* pStatusOption,
													VARIANT* pvarCommandText) = 0;

		virtual	HRESULT					Exec(		BSTR bstrCmdName,
													EnvDTE::vsCommandExecOption ExecuteOption,
													VARIANT* pvarVariantIn,
													VARIANT* pvarVariantOut,
													VARIANT_BOOL* pvbHandled) = 0;

};
//lint -restore


typedef std::map<_bstr_t, CAddInCommandHandler*>	CAddInCommandHandlerMap;
typedef std::pair<_bstr_t, CAddInCommandHandler*>	CAddInCommandHandlerMapPair;
typedef std::vector<CAddInCommandHandler*>			CAddInCommandHandlerVector;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -