Click here to Skip to main content
Click here to Skip to main content

Find Orphaned Resource Constants

, 6 Feb 2004
Rate this:
Please Sign up or sign in to vote.
A Perl script to help locate #define's in your Resource.h file that are no longer referenced by your VS project.

Introduction

You may have noticed that when using Visual Studio 6.0's resource editor, it doesn't do a great job of keeping your resource files clean. If you delete a resource from the editor, it doesn't usually delete the associated #define in your resource.h. While this isn't a huge problem (unless you are running out of constants in the valid ranges), it has always bugged me. I wrote a Perl script which will look at your .dsp, parse though the associated source files, and try to match the constants defined in your Resource.h file. Any constants that are not matched will be written to an output file Orphans.txt.

To use:

  1. You must have Perl installed.
  2. Call using:
> Perl FindOrphanedResources.pl <full path to dsp> [<Resource.h file>="Resource.h"]

Possible problems: I realize that files not included in the DSP may be using the constants defined in the Resource file. Since I couldn't think of any good way to find all the files that #include (somewhere down the chain) the resource.h file, I stuck with just those in the DSP. You may want to verify that the constants identified are truly not being used by any files in your projects. This script will at least narrow down the list for you.

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

Share

About the Author

strtdusty
Web Developer
United States United States
No Biography provided

Comments and Discussions

 
GeneralOrphans.txt or new resource.h PinsussHerbert Yu23-Sep-04 8:07 
General_APS_3D_CONTROLS should not be here PinsussHerbert Yu23-Sep-04 8:05 
GeneralResorg PinsussBart Duijndam24-Feb-04 10:12 
QuestionWhere to install Perl from? PinmemberDavidCrow11-Feb-04 10:20 
AnswerRe: Where to install Perl from? Pinmemberstrtdusty11-Feb-04 17:30 
GeneralTry this PinmemberJohn Miller10-Feb-04 16:08 
GeneralRe: Try this Pinmemberstrtdusty11-Feb-04 17:32 
GeneralRe: Try this PinmemberJohn Miller12-Feb-04 4:28 
GeneralWinTransRC.com PinsitebuilderUwe Keim8-Feb-04 19:31 
GeneralRe: WinTransRC.com PinmemberPhil J Pearson10-Feb-04 8:24 

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.

| Advertise | Privacy | Mobile
Web02 | 2.8.141022.2 | Last Updated 7 Feb 2004
Article Copyright 2004 by strtdusty
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid