Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Resource ID Organiser Add-In for Visual C++ 5.0/6.0/.NET

, 10 Jan 2005 CPOL
An application/add-in to organise and renumber resource symbol IDs
resorg103.zip
ResOrg103.exe
resorg104.zip
ResOrg104.exe
resorgaddinsetup.zip
ResOrgAddInSetup.exe
resorgaddin_executables.zip
ResOrg.exe
BXFileDialog.dll
CJ609Lib.dll
NGLib103.dll
ResOrgAddIn.dll
ResOrgCore.dll
ResOrg.cnt
resorg.fts
ResOrg.hlp
resorgnetaddinsetup.zip
ResOrgNETAddInSetup.msi
resorgnetaddin_executables.zip
ResOrgNETAddInToolWindows.ocx
ResOrgNET.exe
CJ609LibVc7.dll
NGLib103Vc7.dll
ResOrgNETAddIn.dll
ResOrgNETCore.dll
ResOrg.cnt
resorg.fts
ResOrg.hlp
ReadMe.rtf
Licence.rtf
resorgnet_executables.zip
ResOrgNET_executables
CJ609LibVc7.dll
NGLib103Vc7.dll
QHTMLight.dll
ResOrg.cnt
resorg.fts
ResOrg.hlp
ResOrgNETAddIn.dll
ResOrgNETAddInToolWindows.ocx
ResOrgNETCore.dll
resorg_demo.zip
ResOrg103.exe
resorg_executables.zip
ResOrgAddIn.dll
BXFileDialog.dll
CJ609Lib.dll
ResOrg.exe
ResOrg.cnt
resorg.fts
ResOrg.hlp
ResOrgCore.dll
NGLib103.dll
resorg_src.zip
BXFileDialog
BXFileDialog.dsp
Lib
Release
Res
bitmap2.bmp
FileOpen.bmp
filesave.bmp
CJLibrary
CJLibrary
CJLibrary.def
CJLibrary.dsp
CJLibrary.dsw
CJLibrarydep.jpg
CJLibraryStatic.dsp
Debug_Unicode
Release
Release_Unicode
res
Include
res
btn_arro.bmp
btn_explorer.bmp
button_images.bmp
cj_logo.bmp
dragging.cur
handcur.cur
headerba.bmp
hsplitba.cur
icr_hand.cur
nodraggi.cur
PushPin.bmp
Toolbar.bmp
vsplitba.cur
Lib
default.doxygen
NGLibrary
Bin
NGLibrary.def
NGLibrary.dsp
NGLibrary.dsw
Release
Res
Drives.bmp
Release
ResOrg.dsw
ResOrgAddIn
Release
Res
HtmlDoc.ico
ResOrg.ico
ResOrgDoc.ico
TBarLrge.bmp
TBarMedm.bmp
Toolbar.bmp
WorkspaceTabs.bmp
ResOrgAddIn.def
ResOrgAddIn.dsp
ResOrgAddIn.odl
ResOrgAddIn_Res.hm
ResOrgApp
Lint
Release
Res
HtmlDoc.ico
MAINFRAM.BMP
ResOrg.ico
ResOrgDoc.ico
TBarLrge.bmp
TBarMedm.bmp
Toolbar.bmp
workspace.ico
WorkspaceTabs.bmp
ResOrgApp.dsp
ResOrgApp_Res.hm
ResOrgApp_Res.resorg
ResOrgCore
Lint
Release
Res
Anna.bmp
BuildOptions.ico
ComCtl Version Prompt.rtf
File Reload Warning Ex.rtf
File Reload Warning.rtf
Global Next Symbol Value Warning Prompt.rtf
information.ico
Invalid Symbol Name.rtf
Mailing List Prompt.rtf
Next Symbol Value Warning Prompt.rtf
project context menu.bmp
project.ico
RenumWiz Completion.rtf
Report.ico
ResOrg Logo.bmp
ResOrg Updated.rtf
ResOrg.ico
resource file.ico
riverblade_logo.bmp
solution.ico
Symbol Delete Warning.rtf
Symbol Name Warning.rtf
Symbol Rename Warning.rtf
SymbolFile.ico
Symbols Delete Warning.rtf
sym_binary.ico
sym_bitmap.ico
sym_command.ico
sym_control.ico
sym_dialog.ico
sym_icon.ico
sym_menu.ico
sym_prompt.ico
sym_resource.ico
sym_string.ico
Toolbar.bmp
VcAddIn.ico
VersionCheck.ico
warning.ico
WizardHeader256.bmp
WizardWatermark256.bmp
ResOrgCore.def
ResOrgCore.dsp
ResOrgCore_Res.hm
ResOrgCore_Res.resorg
Xml
ProblemSymbolReportHtml.xsl
SymbolsReportHtml.xsl
ResOrgNETAddIn
AddIn.def
Release
Res
AddIn.rgs
HtmlDoc.ico
ResOrg.ico
ResOrgDoc.ico
Toolbar.bmp
WorkspaceTabs.bmp
ResOrgNETAddInSetup
Banner.jpg
Intro screen.jpg
Licence.rtf
ReadMe.rtf
Release
ResOrg.ico
ResOrgNETAddInSetup.vdproj
ResOrgNETAddInToolWindows
Release
Res
Edit.ico
Properties.ico
Renumber.ico
ResOrgNETAddInToolWindows.ico
ResOrgNETAddInToolWindowsCtrl.bmp
ResOrgNETAddInToolWindows.def
SatelliteDll
Release
res
AboutBoxCmd.bmp
OpenResOrgCmd.bmp
OptionsCmd.bmp
ViewMainToolWinCmd.bmp
/************************************************************************
 *
 *                 Resource ID Organiser Core Library
 *
 * (c) Copyright 2000-2004 by Anna-Jayne Metcalfe (resorg@annasplace.me.uk)
 *                         All rights reserved.
 *
 ************************************************************************
 *                                                                       
 *  Filename    : ResOrgSymbolsDocMultiFile.h
 *
 *  Description : CResOrgSymbolsDocMultiFile - document class for multiple
 *                resource symbol files
 *                
 *  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/ResOrgSymbolsDocMultiFile.cpp $
 *   $Revision: 11 $
 *       $Date: 29/08/04 22:00 $
 *     $Author: Anna $
 *
 *    $History: ResOrgSymbolsDocMultiFile.cpp $
 * 
 * *****************  Version 11  *****************
 * User: Anna         Date: 29/08/04   Time: 22:00
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 *  CResOrgSymbolsDocMultiFile::Serialize() now checks if the file being
 * saved exists before assuming it is read only
 * 
 * *****************  Version 10  *****************
 * User: Anna         Date: 29/08/04   Time: 21:25
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Removed CResOrgSymbolsDocMultiFile::DoOverwritePrompt(). This is now a
 * global function in ResOrgCore-Globals.cpp
 * 
 * *****************  Version 9  *****************
 * User: Anna         Date: 26/03/03   Time: 14:09
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Added CResOrgSymbolsDocMultiFile::GetDisplayTitle() to choose the title
 * displayed for a multi-file Symbols Display
 * 
 * *****************  Version 8  *****************
 * User: Anna         Date: 6/03/03    Time: 23:58
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Minor mod to CResOrgSymbolsDocMultiFile::AddFile()
 * 
 * *****************  Version 7  *****************
 * User: Anna         Date: 4/03/03    Time: 20:50
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * CResOrgSymbolsDocMultiFile::AddFiles() now displays a progress dialog
 * 
 * *****************  Version 6  *****************
 * User: Anna         Date: 15/02/03   Time: 20:49
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Changed big BOOLs into little bools
 * 
 * *****************  Version 5  *****************
 * User: Anna         Date: 28/01/03   Time: 21:19
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Improved multi-file support by allowing files to be Added/Removed from
 * a multi-file display via the File Properties Dialog
 * 
 * *****************  Version 4  *****************
 * User: Anna         Date: 19/01/03   Time: 17:19
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * 1.  Added CResOrgSymbolsDocMultiFile::GetMultiFileSymbolManager()
 * 2.  Added an override of CResOrgSymbolsDoc()::Set
 * 3.  Implemented multi-file saving
 * 
 * *****************  Version 3  *****************
 * User: Anna         Date: 3/01/03    Time: 15:51
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Added a "Files" tab to the Symbol File Properties dialog. Not fully
 * functional yet
 * 
 * *****************  Version 2  *****************
 * User: Anna         Date: 3/01/03    Time: 0:09
 * Updated in $/Projects/AddIns/ResOrg/ResOrgCore
 * Speeded up multi-file loading slightly
 * 
 * *****************  Version 1  *****************
 * User: Anna         Date: 2/01/03    Time: 0:03
 * Created in $/Projects/AddIns/ResOrg/ResOrgCore
 * 
 *
 * $Nokeywords: $
 *
 ************************************************************************/


#include "StdAfx.h"
#include "ResOrgCore_Priv.h"
#include "ResOrgCore_Globals.h"

#include "ResourceSymbolManagerMultiFile.h"
#include "ResourceSymbolFilePropertySheet.h"
#include "ResOrgProgressDlg.h"

#include "ResOrgSymbolsDocMultiFile.h"




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


/////////////////////////////////////////////////////////////////////////////
// CResOrgSymbolsDocMultiFile

IMPLEMENT_DYNCREATE(CResOrgSymbolsDocMultiFile, CResOrgSymbolsDocMultiFile_BASE)

BEGIN_MESSAGE_MAP(CResOrgSymbolsDocMultiFile, CResOrgSymbolsDocMultiFile_BASE)

	ON_COMMAND(				ID_FILE_CLOSE,					OnFileClose)
	ON_COMMAND(				ID_FILE_SAVE,					OnFileSave)
	ON_UPDATE_COMMAND_UI(	ID_FILE_SAVE,					OnUpdateFileSave)
	ON_UPDATE_COMMAND_UI(	ID_FILE_SAVE_AS,				OnUpdateFileSaveAs)
	ON_COMMAND(				ID_FILE_CHANGED,				OnCmdFileChanged)
	ON_COMMAND(				ID_FILE_PROPERTIES,				OnCmdFileProperties)
	ON_COMMAND(				ID_TOOLS_RENUMBER,				OnCmdRenumberSymbols)
	ON_UPDATE_COMMAND_UI(	ID_TOOLS_RENUMBER,				OnUpdateRenumberSymbols)

END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CResOrgSymbolsDocMultiFile construction/destruction

CResOrgSymbolsDocMultiFile::CResOrgSymbolsDocMultiFile(void)
{
}


CResOrgSymbolsDocMultiFile::~CResOrgSymbolsDocMultiFile(void)
{
}


/////////////////////////////////////////////////////////////////////////////
// CResOrgSymbolsDocMultiFile overrides

BOOL CResOrgSymbolsDocMultiFile::OnNewDocument(void)
{
	BOOL bResult = CResOrgSymbolsDocMultiFile_BASE::OnNewDocument();

	return bResult;
}


BOOL CResOrgSymbolsDocMultiFile::OnOpenDocument(LPCTSTR lpszPathName)
{
	BOOL bResult = CResOrgSymbolsDocMultiFile_BASE::OnOpenDocument(lpszPathName);
//	if (bResult)
//	{
//		StartFileChangeMonitor(lpszPathName);
//	}
	return bResult;
}


BOOL CResOrgSymbolsDocMultiFile::OnSaveDocument(LPCTSTR lpszPathName)
{
	BOOL bResult = CResOrgSymbolsDocMultiFile_BASE::OnSaveDocument(lpszPathName);

//	if (bResult)
//	{
//		m_pSymbolManager->SetModifiedFlag(FALSE);
//
//		StartFileChangeMonitor(lpszPathName);
//
//		UpdateAllViews(NULL, SYM_REFRESH);
//	}
	return bResult;
}


void CResOrgSymbolsDocMultiFile::OnCloseDocument(void)
{
//	StopFileChangeMonitor();

	CResOrgSymbolsDocMultiFile_BASE::OnCloseDocument();
}


void CResOrgSymbolsDocMultiFile::DeleteContents(void) 
{
//	if (NULL != m_pSymbolManager)
//	{
//		m_pSymbolManager->RemoveAll();
//	}
//	else
//	{
//		VERIFY( CreateSymbolManager() );
//	}
//
//	UpdateAllViews(NULL, SYM_REFRESH);

	CResOrgSymbolsDocMultiFile_BASE::DeleteContents();
}


bool CResOrgSymbolsDocMultiFile::Set(	CResourceSymbol* pSymbol,
										const CString& sName,
										UINT uValue,
										bool bReadOnly /*= false*/)
{
	CResourceSymbolList listSymbols;

	m_pSymbolManager->GetSymbols(	pSymbol->GetValue(),
									listSymbols);

	// Work out which symbols are affected so we can issue the right view hints
	CResourceSymbolList listSymbolsWithNewValue;

	m_pSymbolManager->GetSymbols(	uValue,
									listSymbolsWithNewValue);

	listSymbols.AddTail(&listSymbolsWithNewValue);

	bool bResult = m_pSymbolManager->Set(	pSymbol,
											sName,
											uValue,
											bReadOnly);
	if (bResult)
	{
		CResourceSymbolManager* pMngr = reinterpret_cast<CResourceSymbolManager*>
														( pSymbol->GetUserData() );
		ASSERT(NULL != pMngr);

		if (Options.AutoFixNextSymbolValues() && (NULL != pMngr) )
		{
			pMngr->FixNextSymbolValues();
		}

		if (m_pSymbolManager->IsModified())
		{
			if (NULL != pMngr)
			{
				pMngr->SetModifiedFlag(true);
			}
			SetModifiedFlag(TRUE);
		}

		POSITION pos = listSymbols.GetHeadPosition();
		while (NULL != pos)
		{
			CResourceSymbol* pSymbol = listSymbols.GetNext(pos);
			if (NULL != pSymbol)
			{
				UpdateAllViews(NULL, SYM_CHANGED, (CObject*)pSymbol);
			}
		}
	}
	return bResult;
}


/////////////////////////////////////////////////////////////////////////////
// CResOrgSymbolsDocMultiFile serialization

void CResOrgSymbolsDocMultiFile::Serialize(CArchive& ar)
{
	CResOrgSymbolsDocMultiFile_BASE::Serialize(ar);

//	if (NULL != m_pSymbolManager)
//	{
//		m_pSymbolManager->Serialize(ar);
//	}
}


/////////////////////////////////////////////////////////////////////////////
// CResOrgSymbolsDocMultiFile diagnostics

#ifdef _DEBUG
void CResOrgSymbolsDocMultiFile::AssertValid(void) const
{
	CResOrgSymbolsDocMultiFile_BASE::AssertValid();
}


void CResOrgSymbolsDocMultiFile::Dump(CDumpContext& dc) const
{
	CResOrgSymbolsDocMultiFile_BASE::Dump(dc);
}
#endif //_DEBUG


/////////////////////////////////////////////////////////////////////////////
// CResOrgSymbolsDocMultiFile operations

CResourceSymbolManagerMultiFile* CResOrgSymbolsDocMultiFile::GetMultiFileSymbolManager(void) const
{
	return static_cast<CResourceSymbolManagerMultiFile*>(m_pSymbolManager);
}


CString CResOrgSymbolsDocMultiFile::GetDisplayTitle(const CStringArray& arraySymbolFilePathNames, int nMaxFiles /*= 2*/)
{
	CString sTitle;

	for (int n = 0; n <  arraySymbolFilePathNames.GetSize(); n++)
	{
		 CNGSplitPath split(arraySymbolFilePathNames[n]);
		 
		 sTitle += split.GetFileName() + split.GetExtension() + _T(", ");

		 if (n + 1 >= nMaxFiles)
		 {
			 if (nMaxFiles < arraySymbolFilePathNames.GetSize() )
			 {
				 sTitle += _T("...");			// Indicate there's more...
			 }
			 break;
		 }
	}
	sTitle.TrimRight( _T(", ") );

	return sTitle;
}


bool CResOrgSymbolsDocMultiFile::AddFiles(const CStringArray& arraySymbolFilePathNames)
{
	ASSERT(NULL != m_pSymbolManager);

	bool bResult = false;

	if ( (NULL != m_pSymbolManager) && (arraySymbolFilePathNames.GetSize() > 0) )
	{	
		CResOrgProgressDlg dlg;

		dlg.Initialise( _T("Open Projects"), arraySymbolFilePathNames.GetSize());
		dlg.Create();

		for (int n = 0; n < arraySymbolFilePathNames.GetSize(); n++)
		{
			CString sPathName = arraySymbolFilePathNames[n];


			if (!sPathName.IsEmpty() )
			{
				CString sCompactedPath;

				LPTSTR pszCompactedPath = sCompactedPath.GetBuffer(_MAX_PATH);

				VERIFY(::PathCompactPathEx(	pszCompactedPath,
											sPathName,
											40,
											0) );

				sCompactedPath.ReleaseBuffer();

				CString sMsg;
				sMsg.Format( _T("Opening <b>%s</b> "), sCompactedPath);

				dlg.SetMessage(sMsg);

				if (NULL != static_cast<CResourceSymbolManagerMultiFile*>(m_pSymbolManager)->AddSymbolFile(sPathName) )
				{
					bResult = true;
				}
			}
		}
		if (bResult)
		{
			m_pSymbolManager->SortByValue();

			m_pSymbolManager->CountConflicts();

			UpdateAllViews(NULL, SYM_REFRESH);
		}
		dlg.DestroyWindow();
	}
	return bResult;
}


/////////////////////////////////////////////////////////////////////////////
// CResOrgSymbolsDocMultiFile implementation

bool CResOrgSymbolsDocMultiFile::CreateSymbolManager(void)
{
	if (NULL == m_pSymbolManager)
	{
		m_pSymbolManager = new CResourceSymbolManagerMultiFile;

		return (NULL != m_pSymbolManager);
	}
	return false;
}


bool CResOrgSymbolsDocMultiFile::StartFileChangeMonitor(const CString& sPathName)
{
	UNREFERENCED_PARAMETER(sPathName);

/*	if (!m_FileChangeMonitor.IsMonitoring())
	{
		POSITION pos = GetFirstViewPosition();
		if (pos != NULL)
		{
			CView* pView = GetNextView(pos);

			return m_FileChangeMonitor.Start(	sPathName,
												pView,
												WM_COMMAND,
												ID_FILE_CHANGED,
												THREAD_PRIORITY_LOWEST);
		}
	}
*/
	return false;
}


bool CResOrgSymbolsDocMultiFile::StopFileChangeMonitor(void)
{
//	if (m_FileChangeMonitor.IsMonitoring())
//	{
//		return m_FileChangeMonitor.Stop();
//	}
	return false;
}


// TODO: Move this to the ResOrgCore namespace as a helper function
// (CResOrgNETAddInToolWinFormView has the same code!)
bool CResOrgSymbolsDocMultiFile::Save(CResourceSymbolManager* pSymbols)
{
	bool bResult = false;

	CString sPathName = pSymbols->GetPathName();
	if (!sPathName.IsEmpty() )
	{
		DWORD dwAttrib = ::GetFileAttributes(sPathName);
		if (::FileExists(sPathName) && (dwAttrib & FILE_ATTRIBUTE_READONLY) )
		{
			UINT eResult = ::DoOverwritePrompt(sPathName);
			switch (eResult)
			{
			case IDYES:
				if (!::SetFileAttributes(sPathName, dwAttrib & ~FILE_ATTRIBUTE_READONLY) )
				{
					::AfxMessageBox(IDP_SYM_FILE_ERR_FILE_ATTRIBUTES, MB_OK | MB_ICONSTOP);

					return false;
				}
				break;

			case IDNO:
				{
					CFileDialog dlg(FALSE,									// Save As
									CString( (LPCTSTR)IDS_FILE_FILTER_RESOURCE_SYMBOL_FILES_EXT),
																			// Default extension
									NULL,									// Default filename
									OFN_PATHMUSTEXIST | OFN_ENABLESIZING,	// Flags
									CString( (LPCTSTR)IDS_FILE_FILTER_RESOURCE_SYMBOL_FILES),
																			// File filter
									::AfxGetMainWnd() );					// Parent window

					if (IDOK != dlg.DoModal())
					{
						return false;
					}
					sPathName = dlg.GetPathName();
				}
				break;

			case IDCANCEL:
				return false;

			default:
				ASSERT(FALSE);
				break;
			}
		}

		try
		{
			// Save the file to disk
			CStdioFile f(	sPathName,
							CFile::modeWrite | CFile::modeCreate | CFile::shareDenyWrite);

			// File opened OK
			//
			// Now create an archive, and an empty text buffer
			CArchive ar(&f, CArchive::store);

			pSymbols->Serialize(ar);

			ar.Flush();
			ar.Close();
			f.Flush();
			f.Close();

			bResult = true;
		}
		catch (CException* e)
		{
			TCHAR szCause[_MAX_PATH];
			e->GetErrorMessage(szCause, _MAX_PATH);
			CString sMsg;

			sMsg.Format(IDP_SYM_FILE_ERR_SAVE_FILE, szCause);

			TRACE1("%s\n", sMsg);
			::AfxMessageBox(sMsg, MB_OK | MB_ICONSTOP);

			e->Delete();
		}
	}
	return bResult;
}


/////////////////////////////////////////////////////////////////////////////
// CResOrgSymbolsDocMultiFile message handlers

void CResOrgSymbolsDocMultiFile::OnCmdFileChanged(void)
{
/*
	CString sPathName = GetPathName();

	CNGSplitPath split(sPathName);
	CString sFileName = split.GetFileName() + split.GetExtension();

	BOOL bModified	= IsModified();
	BOOL bPrompt	= bModified || !Options.AutoReloadFiles();
	BOOL bReload	= !bModified && Options.AutoReloadFiles();

	if (bPrompt)
	{
		CNGMessageBox dlg;

		dlg.FormatMsgEx(MAKEINTRESOURCE( bModified ? IDP_SYM_FILE_CHANGED_EX : IDP_SYM_FILE_CHANGED),
						_T("RTF"),
						sFileName);
		dlg.SetRtf();
		dlg.SetStandardIcon(IDI_WARNING);
		dlg.AddButton(IDYES, FALSE, FALSE, _T("&Yes") );
		dlg.AddButton(IDNO, TRUE, TRUE, _T("&No") );

		bReload =  (IDYES == dlg.DoModal() );
	}

	if (bReload)
	{
		OnOpenDocument(sPathName);
		UpdateAllViews(NULL, SYM_REFRESH);
	}
	else
	{
		StartFileChangeMonitor(sPathName);
	}
*/
}


void CResOrgSymbolsDocMultiFile::OnFileSave(void)
{
//	StopFileChangeMonitor();

	if (NULL != m_pSymbolManager)
	{
		CStringArray arrayPathNames;
		GetMultiFileSymbolManager()->GetSymbolFilePathNames(arrayPathNames);

		CStringArray arrayFailedSaves;

		for (int n = 0; n < arrayPathNames.GetSize(); n++)
		{
			CString sPathName = arrayPathNames[n];
			if (!sPathName.IsEmpty() )
			{
				CResourceSymbolManager* pMngr = GetMultiFileSymbolManager()->GetSymbolManager(sPathName);
				if ( (NULL != pMngr) && pMngr->IsModified() )
				{
					if (Save(pMngr) )
					{
						pMngr->SetModifiedFlag(false);
					}
					else
					{
						// We'll probably use this later
						arrayFailedSaves.Add(pMngr->GetPathName() );
					}
				}
			}
		}
		bool bModified = (arrayFailedSaves.GetSize() > 0);

		SetModifiedFlag(bModified);

		m_pSymbolManager->SetModifiedFlag(bModified);		// This really should be linked to the document...
	}
}


void CResOrgSymbolsDocMultiFile::OnUpdateFileSave(CCmdUI* pCmdUI)
{
	BOOL bEnable = FALSE;

	if (NULL != GetMultiFileSymbolManager() )
	{
		bEnable = (GetMultiFileSymbolManager()->GetSymbolFileCount() > 0);
	}
	pCmdUI->Enable(bEnable);
}


void CResOrgSymbolsDocMultiFile::OnUpdateFileSaveAs(CCmdUI* pCmdUI)
{
	pCmdUI->Enable(FALSE);
}


// Renumber all symbols
void CResOrgSymbolsDocMultiFile::OnCmdRenumberSymbols(void) 
{
/*	// To renumber all the symbols in a given file we need to pick starting
	// values for each of the four symbol catgories identified by the _APS_NEXT...
	// symbols in each resource file.
	//
	// The Symbol Renumbering Wizard works this out by looking at the values
	// of existing symbols in the resource symbol file.
	//
	CRenumWizard Wizard;
	Wizard.Initialise(m_pSymbolManager);

	if (ID_WIZFINISH == Wizard.DoModal() )
	{
		if (m_pSymbolManager->IsModified() )
		{
			SetModifiedFlag(TRUE);
			UpdateAllViews(NULL, SYM_REFRESH);
		}
	}
*/
}


void CResOrgSymbolsDocMultiFile::OnUpdateRenumberSymbols(CCmdUI* pCmdUI)
{
//	pCmdUI->Enable(m_pSymbolManager->GetSymbolCount() > 0);
	pCmdUI->Enable(FALSE);		// Temporary
}


void CResOrgSymbolsDocMultiFile::OnCmdFileProperties(void) 
{
	CResourceSymbolFilePropertySheet dlg(IDP_SYM_FILE_PROPERTIES_CAPTION, ::AfxGetMainWnd() );

	dlg.Initialise(m_pSymbolManager, this);

	dlg.DoModal();

	if (m_pSymbolManager->IsModified() )
	{
		CStringArray arrayPathNames;
		GetMultiFileSymbolManager()->GetSymbolFilePathNames(arrayPathNames);
			
		SetTitle( GetDisplayTitle(arrayPathNames) );

		SetModifiedFlag(TRUE);
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Anna-Jayne Metcalfe
Founder Riverblade Limited
United Kingdom United Kingdom
I haven't always written software for a living. When I graduated from Surrey University in 1989, it was with an Electronic Engineering degree, but unfortunately that never really gave me the opportunity to do anything particularly interesting (with the possible exception of designing Darth Vader's Codpiece * for the UK Army in 1990).
    * Also known as the Standard Army Bootswitch. But that's another story...
Since the opportunity arose to lead a software team developing C++ software for Avionic Test Systems in 1996, I've not looked back. More recently I've been involved in the development of subsea acoustic navigation systems, digital TV broadcast systems, port security/tracking systems, and most recently software development tools with my own company, Riverblade Ltd.
 
One of my personal specialities is IDE plug-in development. ResOrg was my first attempt at a plug-in, but my day to day work is with Visual Lint, an interactive code analysis tool environment with works within the Visual Studio and Eclipse IDEs or on build servers.
 
I love lots of things, but particularly music, photography and anything connected with history or engineering. I despise ignorant, intolerant and obstructive people - and it shows...I can be a bolshy cow if you wind me up the wrong way...Laugh | :laugh:
 
I'm currently based 15 minutes walk from the beach in Bournemouth on the south coast of England. Since I moved here I've grown to love the place - even if it is full of grockles in Summer!
Follow on   Twitter

| Advertise | Privacy | Mobile
Web01 | 2.8.141015.1 | Last Updated 10 Jan 2005
Article Copyright 2001 by Anna-Jayne Metcalfe
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid