|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
VC++ IDE Q: How to Reuse a Dialog in Different Projects?
This seems like it should be a basic question, but I've never found the answer to it.
I'm using VC++6 (my own), and sometimes VC++5 (the standard at work). In one project, I create a dialog box and the associated CDialog class. Now I want to use that exact same dialog box resource and code in another project. How do I do that? What I've always had to do was to hand-craft the transfer. I would copy the resource over from the one project to the second, then hand-edit the resource IDs and update all the necessary definitions. Then (the easy part), I would copy and .cpp source and header files over and add them to the project. Don't get me wrong. I am very thankful that I have access to the code for tweaking (unlike in VB), but still it seems that the IDE should have a built-in solution for what must be a very common need. |
|
#2
|
|||
|
|||
|
I've never found an easy way of doing it. The resource IDs are pretty straight forward, along with the source code. But for the actual dialog template, I've always had to resort to shutting down vc and coyping and pasting from the project rc script files.
|
|
#3
|
|||
|
|||
|
Open the old projects script.rc in the new project (with the open file menu item) so you have two scripts.
Now you should be able to browse thru the old script in the right hand pane of the complier. Click on the resource you want and [CRTL]+C (copy). Paste into the new projects script.rc [CTRL]+V. Sometimes it will loose a resource ID or two. Just give them a quick check and hit 'rebuild all'.
__________________
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions. Frank Zappa |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > VC++ IDE Q: How to Reuse a Dialog in Different Projects? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|