Click here to Skip to main content
Licence 
First Posted 20 Feb 2006
Views 16,739
Bookmarked 13 times

Order Resource File

By | 20 Feb 2006 | Article
OrderResourceFile sorts the #define values in the resource.h file in alphabetical order. The #define values are also renumbered in sequence, starting with the number 1024.

Introduction

OrderResourceFile sorts the #define values in the resource.h file in alphabetical order. The #define values are also renumbered in sequence, starting with the number 1024.

  1. Execute OrderResourceFile.exe in the same folder that has your "resource.h" file.
  2. Manually copy the new #define values from OrderResourceFile.txt to your "resource.h" file.

Background

This is a simple and useful tool for keeping your code clean.

Using the code

Select and copy (to the clipboard) the text lines above the "#define _APS" values from your OrderResourceFile.txt.

Open "resource.h" and carefully paste these values over the old #define values:

//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by MyProgram.rc
//

#define MYDIALOG_IDC_BUTTON_1 1024   // START PASTING HERE
#define MYDIALOG_IDC_BUTTON_2 1025
#define MYDIALOG_IDC_BUTTON_3 1026
#define WM_DIALOGSTATE_01 1027
#define WM_DIALOGSTATE_02 1028
#define WM_DIALOGSTATE_03 1029      // STOP PASTING HERE

// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        201
#define _APS_NEXT_COMMAND_VALUE         32768
#define _APS_NEXT_CONTROL_VALUE         206
#define _APS_NEXT_SYMED_VALUE           134
#endif
#endif

Points of Interest

Sometimes Visual Studio .NET 2003 complains with an "end of file" error in resource.h if I paste in the areas not specified above.

History

Original article created.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

DvssCoder

Engineer

United States United States

Member

C++, MFC, ActiveX, DirectShow, GDAL

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralTwo controls with same id in resource file Pinmemberhariakuthota0:02 4 Sep '08  
GeneralDangerous approach PinmemberDamir Valiulin6:23 26 May '06  
AnswerRe: Dangerous approach PinmemberDvssCoder17:45 19 Jun '06  
Generalcould be useful Pinmemberkzipperer1:43 3 Mar '06  
Generalone doubt... PinmemberSumit Kapoor12:58 28 Feb '06  
GeneralMaybe useful, but... PinmemberYoSilver1:55 21 Feb '06  
GeneralRe: Maybe useful, but... PinmemberChris Conn9:16 21 Feb '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 20 Feb 2006
Article Copyright 2006 by DvssCoder
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid