RC 文件更改会默默失败; “无法打开资源文件进行编辑”
我一段时间以来第一次尝试使用 Visual Studio 2008 更改本机 C++ 项目中的资源。在过去,这很有效,但现在资源编辑器以奇怪的方式失败。
如果我使用 GUI 进行更改,则更改要么根本不会发生,要么立即消失。例如,我可以尝试将静态文本控件上的标题从“Foo”更改为“Bar”。当我键入时,“Bar”就会出现,但当我按 Enter 时,“Foo”会立即替换它。
如果我尝试使用资源视图上下文菜单下的插入项目添加新资源,我会收到一个错误对话框,指出“无法打开资源文件进行编辑”。
我已尝试以下操作但无济于事:
- 重新
- 启动 关闭 Visual Studio,删除关联的 .APS 文件,然后重新启动
- 确保 .RC 文件可写(确实如此)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是由于资源 ID 头文件是只读造成的。
我本来会早点检查一下,但我习惯了 Visual Studio 的早期版本会提示您在资源编辑期间覆盖该文件(如果该文件是只读的)。
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.