Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2008: "Resource file opened in another editor"

But it's a lie!

Good day to all! I have the following problem: when I try to open the resource file PriceCalculationUI.rc Visual Studio 2008 tells me that the file is opened in another editor (in vs2008 I have only 1 opened tab with .cpp file). I checked this information: run Process Explorer and searched for PriceCalculationUI handle. In results I found nothing but devenv.exe that uses PriceCalculationUI directory.

What can I do next?

Thanks for any help!

Additional information: when I rebuild (not build) the project I see dialog window with information that file PriceCalculationUI.rc was edited by another program.

like image 963
GrinderZ Avatar asked Jun 14 '13 06:06

GrinderZ


4 Answers

I have had problems with this error (also in Visual Studio 2010) even when I don't have the .rc file / resource.h file open.

The only way to fix this for me was to manually open both files in the text editor (sometimes I get a msg box "The document '[path]\resource.h' is already open. Do you want to close it? which I answer with Yes), close both the files and try to open the resource file in the resource view.

This MS Connect page suggests closing the solution, deleting the .suo file and reopening the solution.

like image 134
Edward Clements Avatar answered Oct 19 '22 01:10

Edward Clements


If you encounter this issue, you will need to:

  1. close .rc, resource.h files opened inside Visual Studio and outside.
  2. collapse items in VS "Resource View" tab to give VS a chance to refresh.
  3. Try to expand .rc again from "Resource View" tab

The reason VS gives this error, I believe is that VS will automatically update these files. If you open any of these file in an editor, VS thinks there will a chance for conflict. So it gives you an error. Sometime it is a little misleading because VS appears don't know the .rc, and resource.h files are opened by itself. VS shoots itself's foot in this case.

like image 36
user2825261 Avatar answered Oct 19 '22 02:10

user2825261


Problem solved: PriceCalculationUI.rc was opened in VS2008 text editor (right button click on file in solution explorer --> View code) then it was saved and closed. That's all! When I restart VS2008 problem comes back but I know what to do. May be it due to Visual Assist X? I don't know.

P.S.: Thanks for your replies: communion leads to action!

like image 21
GrinderZ Avatar answered Oct 19 '22 02:10

GrinderZ


Close all opened files in VS. Then I am able to open rc file.

like image 3
Libor B. Avatar answered Oct 19 '22 01:10

Libor B.