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

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

, 10 Jan 2005
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
////////////////////////////////////////////////////////////////
// CNGTimer Copyright 1999 by Anna-Jayne Metcalfe (code@annasplace.me.uk)
//
// CNGTimer makes using Timers easy in non-window objects
// like CDocuments.


// NGTimer.cpp : implementation file
//

#include "StdAfx.h"
#include "NGTimer.h"


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


/////////////////////////////////////////////////////////////////////////////
// CNGTimer construction/destruction

CNGTimer::CNGTimer(void)
{
	m_nID			= 0;
	m_nInterval		= 0;
	m_pTarget		= NULL;
	m_nCmdID		= 0;
}


CNGTimer::~CNGTimer(void)
{
	Stop();										// Just in case
}


/////////////////////////////////////////////////////////////////////////////
// CNGTimer overrides

void CNGTimer::OnTimer(DWORD dwTime)
{
	m_dwTime = dwTime;
	if (NULL != m_pTarget)
	{
		m_pTarget->OnCmdMsg(m_nCmdID, CN_COMMAND, NULL, NULL);
	}
}


/////////////////////////////////////////////////////////////////////////////
// CNGTimer operations

/************************************************************************
 *	Start the timer.
 *
 *	The first form start a timer which sends a WM_COMMAND message with a specified
 *	ID to a command target.
 *
 *	The second sends a WM_TIMER message directly to a window.
 *
 *	The third restarts a paused timer
 *
 ************************************************************************/

UINT CNGTimer::Start(	CCmdTarget* pTarget,		// Target to send WM_COMMAND message to
						UINT nID,					// ID of message
						UINT nInterval)				// Interval in ms
{
	ASSERT_VALID(pTarget);
	ASSERT(nID > 0);
	ASSERT(nInterval > 0);

	if (m_nID > 0)									// timer running, so kill it first
	{
		Stop();
	}

	if (nInterval > 0)
	{
		m_nID = ::SetTimer(	NULL,
							0,
							nInterval,
							CNGTimer::TimerProc);

		if (m_nID > 0)
		{
			m_nInterval		= nInterval;
			m_pTarget		= pTarget;
			m_nCmdID		= nID;

			m_mapTimers.SetAt(m_nID, this);
		}
	}
	return m_nID;
}

				
UINT CNGTimer::Start(	CWnd* pWnd,					// Window to send WM_TIMER message to
						UINT nInterval)				// Interval in ms
{
	ASSERT_VALID(pWnd);
	ASSERT(nInterval > 0);

	if (m_nID > 0)									// Timer running, so kill it first
	{
		Stop();
	}

	if (nInterval > 0)
	{
		m_nID = ::SetTimer(	pWnd->GetSafeHwnd(),
							0,
							nInterval,
							NULL);

		if (m_nID > 0)
		{
			m_nInterval		= nInterval;
			m_pTarget		= pWnd;
		}
	}
	return m_nID;
}


UINT CNGTimer::Start(void)
{
	if (NULL != m_pTarget)
	{
		if (m_nCmdID > 0)
		{
			return Start(m_pTarget, m_nCmdID, m_nInterval);
		}
	}
	return Start( (CWnd*)m_pTarget, m_nInterval);
}
				
				

/************************************************************************
 *	Stop the timer
 *
 ************************************************************************/

BOOL CNGTimer::Stop(void)
{
	if (m_nID > 0)								// Timer running?
	{
		::KillTimer(NULL, m_nID);

		m_mapTimers.RemoveKey(m_nID);

		m_nID		= 0;

		return TRUE;
	}
	return FALSE;
}


/************************************************************************
 *	Set Timer Interval. Note: setting the interval while the timer is running will stop it
 *	and create a new timer. SetInterval returns the ID of the new timer if running.
 *
 ************************************************************************/

UINT CNGTimer::SetInterval(UINT nInterval)
{
	m_nInterval = nInterval;					// 0 stops it
	if (m_nID > 0)								// timer running, so kill it first
	{
		Stop();

		return Start();
	}
	return m_nID;
}


/////////////////////////////////////////////////////////////////////////////
// CNGTimer diagnostics

#ifdef _DEBUG
void CNGTimer::AssertValid(void) const
{
	CNGTimer_BASE::AssertValid();
}

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


/////////////////////////////////////////////////////////////////////////////
// CNGTimer Implementation

/************************************************************************
 *	Static callback method to handle timers destined for non-window
 *	command targets
 *
 ************************************************************************/
// Static map used to route timer callbacks back into the document

CMapIDtoTimer CNGTimer::m_mapTimers;

void CALLBACK EXPORT CNGTimer::TimerProc(	HWND /*hWnd*/,      // Handle of CWnd that called SetTimer
											UINT /*nMsg*/,      // WM_TIMER
											UINT nID,			// Timer identification
											DWORD dwTime)		// System time
{
	CNGTimer* pTimer = NULL;
	CNGTimer::m_mapTimers.Lookup(nID, (CNGTimer*&)pTimer);
	ASSERT(NULL != pTimer);
	if (NULL != pTimer)
	{
		pTimer->OnTimer(dwTime);
	}
}

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.140916.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