简体   繁体   中英

RC file changes fail silently; “Cannot open the resource file for edit”

I'm trying to make changes to the resources in a native C++ project using Visual Studio 2008 for the first time in a while. In the past, this has worked, but now the resource editor is failing in strange ways.

If I use the GUI to make a change, the change either doesn't happen at all or disappears immediately. For example, I can try to change the caption on a static text control from "Foo" to "Bar." "Bar" shows up as I type, but "Foo" immediately replaces it when I press enter.

If I try to add a new resource using the Insert items under the context menu of the Resource View, I get an error dialog stating, "Cannot open the resource file for edit."

I've tried the following things to no avail:

  • Rebooting
  • Shutting down Visual Studio, deleting the associated .APS file, and restarting
  • Making sure the .RC file was writable (it was)

This was caused by the resource ID header file being read-only.

I would have checked that sooner, but I'm used to prior versions of Visual Studio prompting you to overwrite the file during resource edits if it is read-only.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM