Solved

Class Wizard and resource dll.

Posted on 2002-04-30
3
246 Views
Last Modified: 2013-11-20
Ok here is the situation.  I have a project that consist of .exe and several .dll.  After finishing with the first revision all resources were stripped out of exe and dll and moved into resourse dll, for future transation in other languages.
Now I come back working on rev.2 of the same project.  I would like continue to use Class Wizard whe I am working with dialog resources.  But now I have .h and .cpp file of dialog class in one dll and resource template in other.  Class Wizard doesn;t seem to handle this situation properly.

Anybody can give me a points on addressing this problem?  I was told that there is some software on a market, but I am totally unintrested in buying any third party software solutions..... at least for now.
0
Comment
Question by:mblat
3 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 6982852
I assume that you want to, for instance, add a new button to a dialg box and then immediately be able to edit the associated code with a double-clik in the dilaog editor.  Here is one way I go that to work:

I have two projects, the EXE and the resource-only DLL.  I deleted the .CLW file from the DLL project dir.  When I open the workspace and attempt to do some ClassWizard stuff, it prompts "do you want to re-create from your files"  I clicked yes.

In the resulting screen, you need to explore around to locate all of the resource-related .cpp and .h files; for instance, I have to go to the parent dir, then to the EXE dir to locate CMyDlg.cpp (and .h) and click the [Add] button to add them to the list.  Do this for all such resource-related class objects.

Now the ClassWizard associates the resource (in the res-only DLL) with the correct source code (in the Exe).

You may need to be careful about the resource.h file.  I'm not sure which copy the ClassWizard will tweak when you add new resources or change IDs, so you need to have just ONE resouce.h file for both projects.  Delete (well rename to keep for backup) the one in the EXE folder and in
    project / settings / c/c++ /Category: Preprocessr / Additional Include dirs:

put a referecne to the project directory for the EXE.

I'm not sure how this will affect your current setup (I assume you had to do some miscellaneous tweaking to get the res-only DLL to be used...).  So please make a complete backup of your current functional system before trying this.

-- Dan
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 6983345
2 mblat
I try to explain how we used one resource DLL for many sub projects.
1. We rename all resource.h to rc_projectName.h from resource editor.
2. We create a new project for Resource DLL.
3. On the Resource View/Resource Includes we add all needed headers and Rc files.
4. We create new project configuration and exclude from build resource files.
5. In source code if we not found the resource dll we use standard resource handle.

With this technique we can use sub projects for different application with or without resource DLL and we can use Class Wizard without the problem.
Note: each sub project has a predefined resource id range.
0
 
LVL 4

Author Comment

by:mblat
ID: 6983844
Thank you, I'll try both ways and let you now what the result.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sum28 challenge 31 107
no14 challenge 14 62
Dell Alienware Graphics Amplifier Driver for non-Alienware systems 18 195
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 286
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now