[RESOLVED] Replace resources of new project with old
I'd like to completely replace the resources of a new project with those of an old. I've tried deleting the .rc file of the new and replacing it with the old (renamed to mimic the new), but the darn thing still thinks I want the new resources. How can I get this to replace?
I'm using Visual Studio 2010, but I still walk uphill in the snow both ways.
Thanks
Re: Replace resources of new project with old
Did you replace the resource,h together with .rc?
Did you do the Rebuild All after that?
Re: Replace resources of new project with old
Quote:
but the darn thing still thinks I want the new resources. How can I get this to replace?
I dare say, the thing isn't able to think, it just reacts to the instruction that you give it. Do it right, or react back to the error messages the thing provides and correct yourself, or let us see the messages to help you to react correct way.
Re: Replace resources of new project with old
VictorN,
Thank you for your patience. Here are the steps I took:
1) I deleted the new Resource.h and .rc files entirely and copied the old files from the old project folder into the new project folder.
2) I added these old files to the new project in VC 2010 via "add -> existing item..."
3) I rebuilt the project, and I'm getting thousands of errors about not knowing what the various resource names are (i.e. error C2065: 'IDD_CLIENT_CONNECTION_DIALOG' : undeclared identifier, etc.) In addition, the resource view STILL shows the new resources.
Where else is this information being stored if not in the .h and .rc folder?
Igor,
Thank you for your reply, and I apologize for the lack of technical precision in my original post. I thought my statement that I deleted the old .rc file and replaced it with the new one was descriptive enough . . . especially for someone else who might know of the two or three other steps I'm probably missing. Listing thousands of errors seems overkill. I am well aware that computer's do not "think," at least insofar as we regard that concept. Computers also don't use common vernacular that suffices to get the point across. If they did, we probably wouldn't need forums.
Re: Replace resources of new project with old
Quote:
Originally Posted by
paradoxresolved
...
1) I deleted the new Resource.h and .rc files entirely and copied the old files from the old project folder into the new project folder.
Does the "old" .rc file have the same name as the "new" one that you have deleted?
Re: Replace resources of new project with old
Quote:
2) I added these old files to the new project in VC 2010 via "add -> existing item..."
That was unnecessary. Just replacing the files contents (including res folder of course) and probably killing .ncb/.sdf file would do. You could do a little training session like creating some dummy project, making changes to resources, taking the closed project snapshot, making further changes, closing the project and trying to replace the resource related stuff from the snapshot you previously have taken. With a diffing tool, like WinMerge you could clearly see the changes. Well, the easiest case would be if some version control system was in use. ;)
Quote:
Listing thousands of errors seems overkill.
At least "the darn thing still thinks I want the new resources" needed to be illustrated somehow.
1 Attachment(s)
Re: Replace resources of new project with old
Here is how to import resource files (or parts of resource files) contents in a "visual" manner.
It avoids "manually" working with .RC files and implicitly prevents headaches because of eventually inconsistencies and conflicts (between resource IDs, and so on).
- In "Solution Explorer" window, right click in .RC file name, select "Open with...", then "Resource Editor".
- Chose "File/Open/File..." menu (or hit Ctrl+O)
- Find, select then open the "import" .RC file.
- Select "Window/New Vertical Tab Group".
Now, you can see both resource files contents side by side
Further, it's a piece of cake to copy & paste or drag & drop from one to another.
1 Attachment(s)
Re: Replace resources of new project with old
[ continued ]
One even simpler method is to (temporarily) add in the solution, the project containing the resources to be imported
This case you can enjoy of copy & paste or drag & drop directly in the "Resource View" window.
After importing is done, you may remove that project from the solution.
1 Attachment(s)
Re: Replace resources of new project with old
[ continued ]
And yet another one:
- In "Solution Explorer" window, right ckick on "Resource Files" branch, then choose "Add/Existing Item..." menu.
- Search then open the .RC file to whit the resources to be imported.
- Copy & paste or drag & drop in "Resource View" window.
- When import is done, remove the import .RC file from the project.
And sould be more... :)
Re: Replace resources of new project with old
ovidiucucu,
The second method worked quite well! Thank you!