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

📄 resorgcore.cpp

📁 ResOrg 图形化管理Vc项目的资源ID的工具的源代码。 ResOrg - Manage and Renumber Resource Symbol IDs Introduction The
💻 CPP
字号:
/************************************************************************
 *
 *                 Resource ID Organiser Core Library
 *
 * (c) Copyright 2000-2004 by Anna-Jayne Metcalfe (resorg@annasplace.me.uk)
 *                         All rights reserved.
 *
 ************************************************************************
 *                                                                       
 *  Filename    : ResOrgCore.cpp
 *
 *  Description : DLL initialization routines and global functions
 *                
 *  Compiler    : Microsoft Visual C++ 6.0, Service Pack 3 or later
 *                Microsoft Visual C++ .NET 2003
 *                                                                       
 *  Target                                                               
 *  Environment : Windows 98/NT/2000/XP
 *
 *  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 Anna-Jayne 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.annasplace.me.uk/resorg 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/ResOrgCore/ResOrgCore.cpp $
 *   $Revision: 13 $
 *       $Date: 29/08/04 21:39 $
 *     $Author: Anna $
 *
 *    $History: ResOrgCore.cpp $
 * 
 * *****************  Version 13  *****************
 * User: Anna         Date: 29/08/04   Time: 21:39
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Moved global functions to ResOrgCore_Globals.h
 * 
 * *****************  Version 12  *****************
 * User: Anna         Date: 24/03/03   Time: 23:39
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Added Doxygen mainpage documentation
 * 
 * *****************  Version 11  *****************
 * User: Anna         Date: 2/01/03    Time: 0:08
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Updated file banner
 * 
 * *****************  Version 10  *****************
 * User: Anna         Date: 25/11/02   Time: 15:11
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Changed website address in banner
 * 
 * *****************  Version 9  *****************
 * User: Anna         Date: 22/10/02   Time: 13:24
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Changed name/mail address (at last!)
 * 
 * *****************  Version 8  *****************
 * User: Andy         Date: 10/08/02   Time: 0:14
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * DoVersionExpiryCheck() now takes a pointer to the parent window as an
 * optional parameter
 * 
 * *****************  Version 7  *****************
 * User: Andy         Date: 7/06/02    Time: 17:04
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Renamed the ResOrgUtils module to ResOrgCore. Updated file banners
 * accordingly
 * 
 * *****************  Version 6  *****************
 * User: Andy         Date: 26/05/01   Time: 15:14
 * Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
 * Added Mailing List prompt option
 * 
 * *****************  Version 5  *****************
 * User: Andy         Date: 5/04/01    Time: 6:10
 * Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
 * Added support for version expiry (conditional compilation)
 * 
 * *****************  Version 4  *****************
 * User: Andy         Date: 2/03/01    Time: 13:12
 * Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
 * Added GetSymbolFileName() function [previously in CWorkspaceHelper]
 * 
 * *****************  Version 3  *****************
 * User: Andy         Date: 17/02/01   Time: 7:01
 * Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
 * Added "SymbolTypes" global helper object
 * 
 * *****************  Version 2  *****************
 * User: Andy         Date: 29/11/00   Time: 18:38
 * Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
 *  Added file banners
 *
 * $Nokeywords: $
 *
 ************************************************************************/


#include "stdafx.h"
#include <afxdllx.h>

#include "ResOrgCore_Priv.h"
#include "ResOrgCore_Res.h"

#include "ResourceSymbolTypes.h"
#include "ResOrgOptions.h"


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


// Doxygen documentation - generates the start page
/*! \mainpage ResOrg Source Code
<p align="left">The ResOrg source includes <i>both</i> the Visual C++ 6.0 workspace and
Visual C++ .NET solution. The projects within the two workspaces (to use VC6 terminology) differ
slightly, although the core components are common. The projects are:</p>
<br>

<p>&nbsp;
<table border="0" width="90%">
  <tr>
    <th>Project </th>
    <th>Description </th>
    <th align="center">VC6.0? </th>
    <th align="center">VC.NET? </th>
    <th>&nbsp; 
  </tr>
  <tr>
    <td><b>%BXFileDialog</b></td>
    <td>An extension library hosting David Wulf's Office2K style file dialog class 
      and an associated <code>CDocManager</code> class </td>
    <td align="center">yes </td>
    <td align="center">no </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>CJLibrary</b></td>
    <td>The excellent CodeJock library (alas no longer available) from <a href="http://www.codejock.com">www.codejock.com</a> 
      provides the framework for the user interface, including support for the 
      docking projects display and "cool" menus </td>
    <td align="center">yes </td>
    <td align="center">yes </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>NGLibrary</b> </td>
    <td>My own extension library which provides general purpose classes, many 
      of which are from either CodeGuru, CodeProject or MSJ, renamed with a "CNG" 
      prefix for namespacing reasons</td>
    <td align="center">yes </td>
    <td align="center">yes </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ResOrgAddIn</b> </td>
    <td>The Visual C++ 5.0/6.0 add-in (an MFC regular DLL) </td>
    <td align="center">yes </td>
    <td align="center">no</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ResOrgApp</b> </td>
    <td>The standalone ResOrg application </td>
    <td align="center">yes </td>
    <td align="center">yes </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ResOrgCore</b> </td>
    <td>The Core ResOrg module. Most of the useful and interesting stuff lives 
      here! </td>
    <td align="center">yes </td>
    <td align="center">yes </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ResOrgNETAddIn</b> </td>
    <td>The Visual C++ .NET add-in (an MFC regular DLL) </td>
    <td align="center">no</td>
    <td align="center">yes </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>ResOrgNETAddInToolWindows</b></td>
    <td>An ActiveX control DLL used by the Visual C++ .NET add-in to host tool 
      windows within the IDE </td>
    <td align="center">no </td>
    <td align="center">yes </td>
    <td>&nbsp;</td>
  </tr>
</table>
</p>
<p align="left">The ResOrg add-ins are a little unusual in that they are implemented as an MDI
application rather than the usual modal dialog or property sheet.</p>

<p>To allow this to happen, the mainframe contains a <code>DoModal()</code> method which uses
<code>CWnd::RunModalLoop()</code> to create a modal mainframe which performs in a similar manner to its
<code>CDialog</code> counterpart. When the add-in is invoked, its main window will appear (starting
the modal loop), and the Visual C++ main window will be hidden. When the main window of the add-in
is closed (ending the modal loop), Visual C++ will reappear.</p>

<p>Beyond that, its structure is that of a conventional MDI application, save for some additional
plumbing to integrate a "workspace" docking window and David Wulf's
<a href="http://www.codeproject.com/dialog/win2kfiledlg.asp" target="_blank">Office2K style File
Dialogs</a> (the latter in the VC 5.0/6.0 version only).</p>

<p>&nbsp;</p>

<h2><b>Source Code Control</b></h2>
<p>The projects within the VC 6.0 workspace may have integrated Source Code Control enabled.</p>
<p>To open the workspace without access to the SourceSafe Database, please run the macro
<a href="../Toggle%20DevStudio%20SCC.vbs">Toggle DevStudio SCC.vbs</a> to disable integrated source code control
before attempting to load it (you will have to restart Visual Studio for the change to take effect).</p>

*/


RESORGCORE_EXT_DATA	CResOrgOptions			Options;
RESORGCORE_EXT_DATA	CResourceSymbolTypes	SymbolTypes;


static AFX_EXTENSION_MODULE ResOrgCoreDLL = { NULL, NULL };

extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
	// Remove this if you use lpReserved
	UNREFERENCED_PARAMETER(lpReserved);

	if (dwReason == DLL_PROCESS_ATTACH)
	{
		TRACE0("ResOrgCore.DLL Initializing!\n");
		
		// Extension DLL one-time initialization
		if (!AfxInitExtensionModule(ResOrgCoreDLL, hInstance))
			return 0;

		// Insert this DLL into the resource chain
		// NOTE: If this Extension DLL is being implicitly linked to by
		//  an MFC Regular DLL (such as an ActiveX Control)
		//  instead of an MFC application, then you will want to
		//  remove this line from DllMain and put it in a separate
		//  function exported from this Extension DLL.  The Regular DLL
		//  that uses this Extension DLL should then explicitly call that
		//  function to initialize this Extension DLL.  Otherwise,
		//  the CDynLinkLibrary object will not be attached to the
		//  Regular DLL's resource chain, and serious problems will
		//  result.

		new CDynLinkLibrary(ResOrgCoreDLL);
	}
	else if (dwReason == DLL_PROCESS_DETACH)
	{
		TRACE0("ResOrgCore.DLL Terminating!\n");
		// Terminate the library before destructors are called
		AfxTermExtensionModule(ResOrgCoreDLL);
	}
	return 1;   // ok
}


// Exported DLL initialization is run in context of application
// or Regular DLL.
RESORGCORE_EXT_API void WINAPI InitResOrgCore(void)
{
   // Create a new CDynLinkLibrary for this app.
   new CDynLinkLibrary(ResOrgCoreDLL);

   // Add other initialization here.
}

⌨️ 快捷键说明

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