Solved

Class Wizard and resource dll.

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

13 Experts available now in Live!

Get 1:1 Help Now