-
March 15th, 2013, 05:24 AM
#1
Resource view takes hangs when trying to edit rc file
No idea how to solve it. Found an online suggestion of using an rc2 file and cut and paste stuff from .rc file to .rc2 file to see which line causes the problem but don't know how to create a blank .rc2 file. Problem started after I ported from VC++ 6 to VS2010.
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
-
March 15th, 2013, 07:17 AM
#2
Re: Resource view takes hangs when trying to edit rc file
.rc2 file is created by AppWizard and is placed into project res folder.
Victor Nijegorodov
-
March 15th, 2013, 07:23 AM
#3
Re: Resource view takes hangs when trying to edit rc file
Resource files have the extension .rc. These files can be copied like any other file. So if your original .rc file is called res.rc then a copy could be called res2.rc. These .rc files are text and can be edited. For your project, the solution explorer window states which .rc file(s) are used under the Resource Files branch of the tree. To use another .rc file, right click the existing name and choose remove. Then right click the Resource Files branch and choose Add, Add Existing Item and select the new resource file.
You can also right click on the .rc file in the Solution Explorer and choose Open With and then select Source Code (Text) Editor. This will display the .rc file within VS as a text file that can be edited and then saved.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
March 17th, 2013, 02:26 AM
#4
Re: Resource view takes hangs when trying to edit rc file
Normally, should be not any problem with resources when porting to a newer Visual Studio version.
And, if something is wrong in the resource script (.rc) file, the resource editor should not hang but give a message box describing the error and having two buttons "OK" and "Edit Code".
If push "Edit Code", the IDE opens the .rc file in a text editor, pointing to the wrong line.
Well, let's say: "Shi_t happens!".
Most possible, you got problems because of some manually edited stuff in the original project.
Just to note: the .rc file contains a lot of stuff generated by the Visual Studio IDE.
I highly recommend to avoid manually editing it (by using a text editor), because:
- your changes may be lost when further change resources by using the resource editor;
- you can do mistakes.
However if really, really need it (in rare cases), then can use that .rc2 file, which is for "non-Microsoft Visual C++ edited resources", i.e. for manually edited resources. The .rc2 file is usually generated by the wizard for some types of projects, as Victor already said, and included in the .rc file (using #include directive). If it's not present in your project, you can add one yourself and include it like the wizard does.
Then, you can put there resource stuff that can be manually edited with no fear.
But again, do that only if it's absolutely necessary and if you are sure what you are doing.
Probably, one "code monkey", desperately searching for a solution, has moved the blocks one by one. from .rc to the .rc2 file until the resource has been successfully loaded.
I think, the wrong block can be found even easier by commenting in the .rc file.
But I would like to recommend something else.
In VC6.0, open the resource editor and do some minor change (e.g. move a button one unit to the right). Save or compile/build, close VC6.0 then port the project in newer Visual Studio version. That way, you force the IDE to correctly re-generate the resource script file and get rid of manually added mistakes. If some important changes has been also lost, you can add them back in the ported project, eventually using 2kaud suggestions. But again, beware of my above remarks!
Finally, AFAIK, the resource editor may also fail in loading resources if the .rc file refer to an ActiveX control that is not registered. Although this is less possible in this context, it's good to be noted and checked, as well.
Last edited by ovidiucucu; March 17th, 2013 at 02:37 AM.
-
March 19th, 2013, 04:50 AM
#5
Re: Resource view takes hangs when trying to edit rc file
Originally Posted by ovidiucucu
Most possible, you got problems because of some manually edited stuff in the original project.
You are correct that I made manual changes in the original project. However, back then in VC++ 6.0 this was never a problem and always loaded correctly. I cannot undo that now however. I did find the .rc2 file, I've never used it and it is indeed where located.
Originally Posted by ovidiucucu
Probably, one "code monkey", desperately searching for a solution, has moved the blocks one by one. from .rc to the .rc2 file until the resource has been successfully loaded.
I think, the wrong block can be found even easier by commenting in the .rc file.
I think I'll try that, thank you.
Originally Posted by ovidiucucu
But I would like to recommend something else.
In VC6.0, open the resource editor and do some minor change (e.g. move a button one unit to the right). Save or compile/build, close VC6.0 then port the project in newer Visual Studio version. That way, you force the IDE to correctly re-generate the resource script file and get rid of manually added mistakes. If some important changes has been also lost, you can add them back in the ported project, eventually using 2kaud suggestions. But again, beware of my above remarks!
The problem I have is that the laptop on which I had VC6.0 was stolen. I now only have VS2010 and we no longer have the installation CD of VC6.0. I had previously converted the project successfully on my old laptop but now things are not working the same. I am now reconverting an older saved version and trying to get it back up to date.
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
-
March 19th, 2013, 05:45 AM
#6
Re: Resource view takes hangs when trying to edit rc file
Somehow the lines with "design info" or whatever of a whole bunch of dialogs I have, were what caused the problems. Those lines don't seem necessary at first sight so I just threw them out. Everything looks fine now.
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
/*
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_RUN, DIALOG
BEGIN
, 50
END
IDD_GRAPH_OPTIONS, DIALOG
BEGIN
, 50
END
IDD_AXES_RANGE, DIALOG
BEGIN
, 50
END
IDD_PARAGRAPH, DIALOG
BEGIN
, 50
END
IDD_CARDDRUMPAIR, DIALOG
BEGIN
, 50
END
IDD_CARDDRUM, DIALOG
BEGIN
, 50
END
IDD_SURF_TEETH, DIALOG
BEGIN
, 50
END
IDD_SETTINGSRIGHTVIEW, DIALOG
BEGIN
, 50
END
IDD_SETTINGSLEFTVIEW, DIALOG
BEGIN
, 50
END
END
#endif // APSTUDIO_INVOKED
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|