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

📄 resorgaddinapp.cpp

📁 一个vc中管理资源文件ID的插件
💻 CPP
📖 第 1 页 / 共 2 页
字号:
/************************************************************************
 *
 *                   Resource ID Organiser Add-In
 *
 *       (c) Copyright 2000-2001 by Andy Metcalfe (andy.metcalfe@lineone.net)
 *                         All rights reserved.
 *
 ************************************************************************
 *                                                                       
 *  Filename    : ResOrgAddInApp.cpp
 *
 *  Description : CResOrgAddInApp - application class
 *
 *  Compiler    : Microsoft Visual C++ 6.0, Service Pack 3 or 4
 *                                                                       
 *  Target                                                               
 *  Environment : Windows 98/NT
 *
 *  NOTE:
 *
 *    This software is provided "as is" free for personal use. All
 *    title and copyrights in and to the software, including but not
 *    limited to any images, text, etc. incorporated into it, are
 *    owned by Andy Metcalfe, except where acknowledged otherwise.
 *
 *    Your may freely to use this code in your own products, PROVIDED
 *    this notice is not removed or modified.
 *
 *
 *    Visit http://www.resorg.co.uk for latest updates
 *
 ************************************************************************
 *
 *   MODIFICATION HISTORY:
 *
 *           This is a controlled document. See project configuration
 *           control tool for latest version and full version history.
 *
 *    $Archive: /Projects/AddIns/ResOrg/ResOrgAddIn/ResOrgAddInApp.cpp $
 *   $Revision: 22 $
 *       $Date: 24/07/01 11:42 $
 *     $Author: Andy $
 *
 *    $History: ResOrgAddInApp.cpp $
 * 
 * *****************  Version 22  *****************
 * User: Andy         Date: 24/07/01   Time: 11:42
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Corrected the Mailing List Prompt to point at the new mailing list
 * 
 * *****************  Version 21  *****************
 * User: Andy         Date: 10/07/01   Time: 9:39
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Fix syntax errors
 * 
 * *****************  Version 20  *****************
 * User: Andy         Date: 8/07/01    Time: 16:56
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Integrated BXFileDialog module (replaces Office2KDlg)
 * 
 * *****************  Version 19  *****************
 * User: Andy         Date: 3/07/01    Time: 20:49
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Fixed a typo
 * 
 * *****************  Version 18  *****************
 * User: Andy         Date: 3/07/01    Time: 20:25
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * 1.  Added Discussion Board to the Help Menu
 * 2.  ResOrg on the Web commands are now disabled if no URL is available
 * 3.  Web windows are now opened in a CChildFrame window so that the
 * first instance is maximised
 * 
 * *****************  Version 17  *****************
 * User: Andy         Date: 5/06/01    Time: 19:32
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Bug fix for context help support
 * 
 * *****************  Version 16  *****************
 * User: Andy         Date: 2/06/01    Time: 19:48
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Added "Close all windows" command (was in the MainFrame before)
 * 
 * *****************  Version 15  *****************
 * User: Andy         Date: 2/06/01    Time: 16:53
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * 1.  Initialised MRU list to 9 entries
 * 2.  Enabled drag/drop
 * 
 * *****************  Version 14  *****************
 * User: Andy         Date: 26/05/01   Time: 21:01
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Fixed a memory leak (forgot to delete m_pHtmlDocTemplate)
 * 
 * *****************  Version 13  *****************
 * User: Andy         Date: 26/05/01   Time: 17:23
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * 1.  Improved help support
 * 2.  Added Mailing List prompt
 * 
 * *****************  Version 12  *****************
 * User: Andy         Date: 22/05/01   Time: 15:56
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Minor bug fixes
 * 
 * *****************  Version 11  *****************
 * User: Andy         Date: 22/05/01   Time: 6:52
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * 1.  Added "ResOrg Mailing List" command to the Help Menu
 * 2.  Tidied up initialisation of document templates
 * 3.  Moved initialisation of "Options" to OnConnection()
 * 4.  Added a call to Options.OnExit() to ExitInstance()
 * 
 * *****************  Version 10  *****************
 * User: Andy         Date: 4/05/01    Time: 22:32
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Set help file name to ResOrg.hlp (overrides the default -
 * ResOrgAddIn.hlp)
 * 
 * *****************  Version 9  *****************
 * User: Andy         Date: 26/04/01   Time: 19:42
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * 1.  Added additional "ResOrg on the Web" commands
 * 2.  Renamed Resource.h to ResOrgAddIn_Res.h
 * 
 * *****************  Version 8  *****************
 * User: Andy         Date: 2/03/01    Time: 17:35
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Removed unnecessary #include directive
 * 
 * *****************  Version 7  *****************
 * User: Andy         Date: 17/02/01   Time: 7:07
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * CResOrgSymbolsView => CResOrgSymbolsListView
 * 
 * *****************  Version 6  *****************
 * User: Andy         Date: 11/12/00   Time: 19:01
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * 1.  Set m_pMainDocTemplate->m_bAutoDelete TRUE to prevent it from
 * leaking
 * 2.  Moved CDocManager memory leak fix to OnDisconnection()
 * 
 * *****************  Version 5  *****************
 * User: Andy         Date: 5/12/00    Time: 20:40
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * 1.  Added "ResOrg on the Web" support
 * 2.  Bug fix for CDocManager related memory leaks. Thanks to Gavin
 * Jerman (gavin.jerman@zurich.co.uk) for this
 * 3.  Raised version to 1.2.1
 * 
 * *****************  Version 4  *****************
 * User: Andy         Date: 3/12/00    Time: 9:20
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Set _crtBreakAlloc in debug builds only
 * 
 * *****************  Version 3  *****************
 * User: Andy         Date: 3/12/00    Time: 8:31
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * Updated registry key
 * 
 * *****************  Version 2  *****************
 * User: Andy         Date: 29/11/00   Time: 18:37
 * Updated in $/Projects/AddIns/ResOrg/ResOrgAddIn
 * 1.  Moved Office2KDlg code to its own DLL
 * 2.  Added file banners
 *
 * $Nokeywords: $
 *
 ************************************************************************/

// ResOrgAddInApp.cpp : implementation file
//

#include "StdAfx.h"
#include <initguid.h>
#include <AfxHtml.h>

#include "ResOrgAddIn_Res.h"

#include "MainFrame.h"
#include "ChildFrame.h"
#include "ResOrgProjectsDoc.h"
#include "ResOrgProjectsView.h"
#include "DSAddIn.h"
#include "Commands.h"
#include "ResOrgAddIn.h"

#include "DtWinVer.h"

#include "ResOrgAddInApp.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


CComModule _Module;


BEGIN_OBJECT_MAP(ObjectMap)
	OBJECT_ENTRY(CLSID_DSAddIn, CDSAddIn)
END_OBJECT_MAP()


CResOrgAddInApp* GetApp(void)
{
	return (CResOrgAddInApp*)AfxGetApp();
}


/////////////////////////////////////////////////////////////////////////////
// CResOrgAddInApp

BEGIN_MESSAGE_MAP(CResOrgAddInApp, CResOrgAddInApp_BASE)
	//{{AFX_MSG_MAP(CResOrgAddInApp)
	ON_COMMAND(				ID_FILE_NEW,				OnFileNew)
	ON_COMMAND(				ID_RESORG_OPTIONS,			OnCmdOptions)
	ON_COMMAND(				ID_RESORG_WEB,				OnCmdResOrgWebsite)
	ON_COMMAND(				ID_RESORG_WEB_FAQ,			OnCmdResOrgFAQ)
	ON_UPDATE_COMMAND_UI(	ID_RESORG_WEB_FAQ,			OnUpdateResOrgFAQ)
	ON_COMMAND(				ID_RESORG_WEB_DISCUSSIONS,	OnCmdResOrgDiscussionBoard)
	ON_UPDATE_COMMAND_UI(	ID_RESORG_WEB_DISCUSSIONS,	OnUpdateResOrgDiscussionBoard)
	ON_COMMAND(				ID_RESORG_WEB_BUGS,			OnCmdResOrgKnownBugs)
	ON_UPDATE_COMMAND_UI(	ID_RESORG_WEB_BUGS,			OnUpdateResOrgKnownBugs)
	ON_COMMAND(				ID_RESORG_MAILING_LIST,		OnCmdResOrgMailingList)
	ON_UPDATE_COMMAND_UI(	ID_RESORG_MAILING_LIST,		OnUpdateResOrgMailingList)
	ON_COMMAND(				ID_APP_ABOUT,				OnCmdAbout)
	ON_COMMAND(				ID_WINDOW_CLOSE_ALL,		OnCmdWindowCloseAll)
	ON_UPDATE_COMMAND_UI(	ID_WINDOW_CLOSE_ALL,		OnUpdateWindowCloseAll)
	//}}AFX_MSG_MAP

	ON_COMMAND(				ID_FILE_OPEN,			CResOrgAddInApp_BASE::OnFileOpen)

	ON_COMMAND(				ID_HELP_FINDER,			CResOrgAddInApp_BASE::OnHelpFinder)
	ON_COMMAND(				ID_HELP,				CResOrgAddInApp_BASE::OnHelp)
	ON_COMMAND(				ID_CONTEXT_HELP,		CResOrgAddInApp_BASE::OnContextHelp)
	ON_COMMAND(				ID_DEFAULT_HELP,		CResOrgAddInApp_BASE::OnHelpFinder)

END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// The one and only CResOrgAddInApp object

CResOrgAddInApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CResOrgAddInApp construction

CResOrgAddInApp::CResOrgAddInApp(void)
{
	m_pDocManager		= NULL;
	m_pMainDocTemplate	= NULL;

#ifdef _DEBUG
	_crtBreakAlloc = -1;
#endif
}


CResOrgAddInApp::~CResOrgAddInApp(void)
{
	if (NULL != m_pHtmlDocTemplate)
	{
		delete m_pHtmlDocTemplate;
	}
}


/////////////////////////////////////////////////////////////////////////////
// CResOrgAddInApp virtual overrides

BOOL CResOrgAddInApp::InitInstance(void)
{
	_Module.Init(ObjectMap, m_hInstance);

	SetRegistryKey(_T("ArryTheDog Software"));

	LoadStdProfileSettings(9);  // Load standard INI file options (including MRU)

	// Create CDynLinkLibrary objects for each of the
	// extension DLLs we use.
	//
	// This is only necessary because DevStudio add-ins
	// must be implemented as Regular DLLs, not extension DLLs.
	//
	// Without this code, the resources in the extension DLLs
	// would be unavailable (much badness, in fact)...
	InitCJLibrary();
	InitNGLibrary();
	InitBXFileDialogDll();
	InitResOrgUtils();

	SetHelpFileName( _T("ResOrg.hlp") );

	return CResOrgAddInApp_BASE::InitInstance();
}


void CResOrgAddInApp::OnConnection(void)
{
	m_pDocManager = new BXFileDialogDocManager;

	// Register the application's document templates.  Document templates
	// serve as the connection between documents, frame windows and views.
	m_pMainDocTemplate = new CMultiDocTemplate(
		IDR_SYMBOL_FILE_TYPE,

⌨️ 快捷键说明

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