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 // 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
#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.