Re: Resources in a static library
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Fri, 14 Dec 2007 11:51:00 -0600
On Fri, 14 Dec 2007 14:31:25 +0100, Stuart Redmann <DerTopper@xxxxxx>
wrote:
Torsten Hensel wrote:
Hi!
I've created a static library that contains a dialog class. The dialog is
created using the dialog editor, so it's described in a resource file.
However, static libraries cannot contain resources.
You are wrong. Static libraries can very well contain resources.
The resources won't be contained in the .lib file. What I suppose you could
do is distribute the resource files alongside the .lib files, but why not
just use a DLL, which doesn't have this issue?
It's just the
resource editor that cannot cope easily with distributed resource IDs.
That's a problem for MFC extension DLLs, too. You have to define resource
ID ranges for each such DLL and stick to them.
So the application using
the lib needs to include the resources. When I add a resource include I must
include the resource.h, but this may lead to resource ID clashes. I could
copy the resources from the library project to the application project, but
this is not what I want. Creating a DLL is no option either.
Why isn't a DLL an option? It's the only way to achieve "privacy" of
resource IDs, but note the comment above about MFC extension DLLs, which
don't offer this privacy, as they are intended to become one with the host
program.
--
Doug Harrison
Visual C++ MVP
.
- References:
- Re: Resources in a static library
- From: Stuart Redmann
- Re: Resources in a static library
- Prev by Date: Re: GDI Shape Question
- Next by Date: Re: Vista-elevation and HKEY_CURRENT_USER
- Previous by thread: Re: Resources in a static library
- Next by thread: Re: Resources in a static library
- Index(es):
Relevant Pages
|