|
-
March 21st, 2005, 07:59 AM
#1
Copy Ressources
Hi,
i have a mfc-dll with some dialogs in it.
Now i want to make a little redesign, and having another mfc-dll, in which
i want to have some of the dialogs of the first mentioned mfc-dll.
But unfortunateley i dont manage it, to copy the dialog ressources from the one project to the other.
Is there any other way, as to copy the binary-data from the one project to the other.
Any hint is welcome, as there are more than a few dialogs to copy.
Thanks in advance,
Matze
-
March 21st, 2005, 08:06 AM
#2
Re: Copy Ressources
I dont think that there is some method to do that using VC editor. i too face this problem many times. the dialog resource code is not stored as binary information in the application. you can find the declaration for the dialog resource in resource.h file, i think you will find 3 references for a particular dialog in that file. the thing you can do is manualy copy that entries in to your new application. i dont think there is some other method for doing it easily. if there is any easy method i too interested to know that
-
March 21st, 2005, 08:28 AM
#3
Re: Copy Ressources
 Originally Posted by matze42
But unfortunateley i dont manage it, to copy the dialog ressources from the one project to the other.
Is there any other way, as to copy the binary-data from the one project to the other.
For some strange reason, the VC++ IDE does not support the external clipboard when copying resources from one running instance of the IDE to another. What you can do, however, is to open the "foreign" resources as a file (File / Open, select the resources (either the compiled DLL, or the .rc, or the .res) and open it. The resources will appear as a tree (in an own MDI child window), and you will be able to copy resources from there to your project workspace.
-
March 21st, 2005, 08:32 AM
#4
Re: Copy Ressources
 Originally Posted by Vinod S
I dont think that there is some method to do that using VC editor.
Yes, there is - see above.
 Originally Posted by Vinod S
the dialog resource code is not stored as binary information in the application.
Yes, it is. All resources are stored in binary format in the executable.
 Originally Posted by Vinod S
you can find the declaration for the dialog resource in resource.h file, i think you will find 3 references for a particular dialog in that file.
That's not the "declaration" - it's just a preprocessor constant for the resource ID.
 Originally Posted by Vinod S
the thing you can do is manualy copy that entries in to your new application.
That won't help - you would need to copy the actual definitions from the .rc file, and you still had to make sure that the resource IDs are unique.
-
March 21st, 2005, 09:34 AM
#5
Re: Copy Ressources
Hi gstercken,
 Originally Posted by gstercken
For some strange reason, the VC++ IDE does not support the external clipboard when copying resources from one running instance of the IDE to another. What you can do, however, is to open the "foreign" resources as a file (File / Open, select the resources (either the compiled DLL, or the .rc, or the .res) and open it. The resources will appear as a tree (in an own MDI child window), and you will be able to copy resources from there to your project workspace.
This way works.
But only if i create a new (empty) Dialog, copy the binary-data of my source and overwrite the binary-data of my target with the copy.
As a remark: One should not forget to copy ( or recreate if already existant ) the IDs of the Dialog-Controls in the Resource.h-File, too.
Many thanks,
Matze
-
March 21st, 2005, 09:47 AM
#6
Re: Copy Ressources
 Originally Posted by matze42
This way works.But only if i create a new (empty) Dialog, copy the binary-data of my source and overwrite the binary-data of my target with the copy.
No, you can copy entire dialog resource templates, or inidividual controls. The IDs will be recreated automagically.
-
March 21st, 2005, 09:53 AM
#7
Re: Copy Ressources
 Originally Posted by gstercken
No, you can copy entire dialog resource templates, or inidividual controls. The IDs will be recreated automagically.
AHA !?!
I will try this.
Copying the Ressource-Template worked.
But where can I past it ?
Matze
-
March 21st, 2005, 09:55 AM
#8
Re: Copy Ressources
 Originally Posted by matze42
Copying the Ressource-Template worked.
But where can I past it ?
As said above: Into the resource view of your project workspace (usually on the left hand side).
-
March 21st, 2005, 09:59 AM
#9
Re: Copy Ressources
OK, works.
Although i'm almost sure, it didn't work the first time i tried it.
Thank you very much,
Matze
-
March 21st, 2005, 02:42 PM
#10
Re: Copy Ressources
I am trying to do the same thing. Copying dialogs in Visual Studio .NET 2003. I have opened the "source" .rc file and see the tree in my destiation project. I drag a dialog from the "source" and paste it into the Resource View. When my mouse crosses the line into the resource view it gives me the circle with a line through it. No way to copy.
What am I doing wrong?
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
|