MBraedley
MBraedley

Reputation: 459

Can't open .rc files in Visual Studio for editing, app compiles fine

I get the an RC1107 error when I try to open any RC for editing, but all my libraries and the app itself compile fine.

Error dialog

I saw this question, but besides not having any useful information, it seems to be a slightly different problem.

I've tried a number of things, from closing and reopening Visual Studio, to ensuring the integrity of the .rc and resource.h files by performing a diff with the previous version. I've even tried rebooting my machine. Any other suggestions?

Upvotes: 6

Views: 12476

Answers (3)

SmacL
SmacL

Reputation: 22922

Adding a new answer here as just started getting the exact same problem on VS2022 all these years later. After a lot of searching around, I found the deleting a file .SUO from the hidden .vs folder cures the problem. I'll add more to the answer if I can figure out what specifically in this file is the issue and how it is triggered.

Edit: Latest build of VS2022 seems to have resolved this,

Microsoft Visual Studio Professional 2022 Version 17.11.4 VisualStudio.17.Release/17.11.4+35312.102
Microsoft .NET Framework Version 4.8.09032

Installed Version: Professional Visual C++ 2022 00476-80000-00000-AA385

Microsoft Visual C++ 2022

Upvotes: 1

Bogdan D.
Bogdan D.

Reputation: 11

This is a solution I discovered in Visual Studio 2017 but it's possible to work in any previous version. It worked in a very weird manner. While having opened the Visual Studio with your project, go in File Explorer to the RC file in your project, right click and open with Visual Studio 2017. The RC file will be opened in the curent project and everything will work like a charm.

Upvotes: 1

MBraedley
MBraedley

Reputation: 459

The answer to the question I linked to actually did contain the right answer, but was so vague as to be useless. After some more searching, I found the solution here, namely this response:

I've had the same issue.

It looks like the include path processing is broken in VS8. I disassembled the resource compiler dll and found that the command line being passed to rcdll.dll was corrupted. The last slash on the include path was being replaced with a quote character. There was no starting quote.

To fix the problem, I made a minor change to the include paths in the IDE.

Tools -> Options -> Projects and Solutions -> VC++ Directories

Show directories for: Include files

I Added a slash to my last path, so "P:\" became "P:\\". Ok the changes and the problem went away. :-)

Hope this works for you.

Andy

Upvotes: 3

Related Questions