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.
- Execute OrderResourceFile.exe in the same folder that has your "resource.h" file.
- 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:
#define MYDIALOG_IDC_BUTTON_1 1024 #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
#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.
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