Visual Studio 2012 can't save file while you use Resource Editor

This article helps you resolve the problem where Microsoft Visual Studio 2012 can't save file while you edit a Visual C++ project.

Original product version:   Visual Studio Premium 2012, Visual Studio Ultimate 2012
Original KB number:   2839032

Symptoms

You're using Visual Studio 2012, where you're editing a Visual C++ project and making changes to a dialog in the Resource Editor. An unexpected message box appears with the error message:

Cannot save file.

Screenshot of the Can't save file error dialog.

Cause

There's an issue with how the AutoRecover feature is interacting with the Resource Editor. When the AutoRecover interval expires, if the resource isn't saved, AutoRecover tries to it.

Note

The default interval is every 5 minutes.

During saving the resource file, it tries to save a file named resource.hm. The resource.hm is used when you're using Context-Sensitive Help, an option when generating a native UI project. When you enable it, it creates help IDs that get written to the help ID header file, resource.hm. There won't be any resource.hm unless you enable the Help ID property for one or more of your resources.

Resolution

  1. Avoid AutoRecover save of edited resources.

    1. Disable the AutoRecover option in Tools > Options > Environment > AutoRecover, by unselecting the Save AutoRecover information every: checkbox:

      Screenshot of the Options window to clear the Save Auto Recover information every checkbox.

    2. Save your edited resources within the specified interval to avoid the triggering of Auto-Save. You may increase the interval, but this interval also increases the risk of losing unsaved work.

  2. Don't use context-sensitive help.

    1. If you aren't using context help ID, then turning that off for every control would be the easiest solution. Turning it off from the resource editor would be safest. In the resource editor, check for all the controls and one of the properties will be Help ID. Set it to False for every control where it's True.

      Screenshot of the Properties window under the Resource View tab with Help ID highlighted.

    2. Instead you could edit the .rc file directly. For instance, removing the last parameter here for every control with a Help ID would turn off the feature:

      DEFPUSHBUTTON "OK",IDOK,103,31,50,14,WS_GROUP,0,HIDOK