Solved

Class Wizard and resource dll.

Posted on 2002-04-30
3
249 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Complete beginner needs help making a cron job 9 116
ShiftLeft challenge 21 81
fix34  challenge 9 117
wordmultiple challenge 12 132
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.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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