Re: ? Segregating a Dialog's Code (Particularly Resources)
Hi Ali,
Do you find this to be a good way to do it in practice? Just curious. Some
of our programmers do this and since my application has to consume all the
DLLs I end up with the DLL and 10 other language DLLs for each little piece
of the program which ends up being about 50 DLLs in my case (all of them
really small). I find it to be really annoying and I'd rather just include
what I need in my main program.
For example, the XTreme Toolkit allows me to either use it as a DLL or link
statically. When I link statically I just include their .rc file (or files
in the case of languages) in the RC file for my main program and satellite
DLLs. This works really well since I end up with one DLL for each language.
I get a slightly larger EXE, but since I need to have the correct version of
the toolkit installed anyway I don't think this makes any difference (load
the DLL or have it statically linked for one use).
I often use DLLs from other (previous) applications either to start with or
just to use, but I typically just copy the content files and then open both
resource files and drag the resources over to the new project. It takes a
few minutes getting started, but ...
The only case I could see for having the code common is if it might change
and you want the changes to affect all projects. I seldom have that issue,
but I could see that being a reason.
Tom
"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message
news:MNJgl.1132$Lr6.453@flpi143.ffdc.sbc.com...
You question is like asking "I want to cut some wood, but don't want to
use a saw!".
Here are other people asking your same question:
http://www.google.com/search?hl=en&q=duplicate+resource++type
I would suggest putting the entire thing in a dll, not just the resource.
Put your dialog class, and its resources in a dll, and include that in as
many projects as you like.
AliR.
"Alec S." <nospam@127.0.0.1> wrote in message
news:u4c6fkxgJHA.1288@TK2MSFTNGP02.phx.gbl...
Hi,
I'm trying to figure out a way to separate a dialog's code (header,
implementation and resources) from the main app so that it is easy to
copy into
other projects (making my own Common Control so to speak).
I have put the dialog's code in a separate file (in a subdirectory of the
main
project), and can easily include that as needed. The problem is the
resources. I
know that you can use multiple resource files (hence RC2, etc.), but
apparently
some resource types (eg icons) are not compatible with separate resource
files.
I can put the dialog resource and guidelines, etc. in a dedicated RC file
and
include that, but once I start adding icons, it breaks (specifically, I
get the
duplicate resource ICON:1 resource compiler error).
I don't want to go the resource-only-DLL route, I am just trying to
figure out
how resource compilations and includes work. I've tried both a
straight-up
#include in my main RC, and a TEXTINCLUDE. I've also tried setting the
dialog's
RC file to be excluded in the project, and that does prevents the error,
but it
still doesn't work right because the dialog cannot see the other
resources (in
the resource editor).
I've messed around with this all day and my test project is getting
pretty
messy, so even if I manage to get it working somehow, I don't think I'll
be able
to figure out what I did to get it to work. :o So I figured I'd ask, in
the
hopes that someone already knows how it can be done.
Thanks a lot.
--
Alec S.
news/alec->synetech/cjb/net