A quirk with Visual Studio 2008 Resource Editor

November 1, 2008

Currently I am working on a MFC application (Yes..I like using MFC and it has improved a lot with Visual Studio 2008. I can talk a lot about MFC but I will keep it for some other time).

For this application I used AppWizard to generate skeleton code for the SDI application. One of the first things I wanted to change was the text for File menu and texts for menu items under this menu. I opened the .rc file in resource editor and went to the File menu, selected and right-clicked on it and opened the Properties window. There I changed value of Caption field from File to Topic. I saved the files and hit the build button. I saw the Compiling Resources message on the build output pane and was sure that the job was done. Once build got over, I launched the program and could not believe what I saw. Menu bar text still showed File instead of Topic.

I quickly opened the .rc file in notepad and verified that the text had actually changed from File to Topic. I had no idea.

I tried changing the text for menu items and they also didn’t seem to change. What was going on there?

Workaround

Looking for the solution, I got this workaround. I will use this as long as I don’t get the real solution.

1. Workaround is to change the ID of any menu item under File menu. Say, ID_FILE_NEW to ID_HELLO_NEW.

2. Save the resources and perform the build.

3. Launch the application. You should see the new text taking effect.

4. You can now revert the changed ID to original one and again perform the build.