>What I did:
>1) #include "commctrl.h"
[quoted text clipped - 3 lines]
>MANIFEST_RESOURCE_ID RT_MANIFEST "myDll.dll.manifest"(manifest contents not
>shown here in this post)
Other than compiling with the definition you mention, ensuring the
definition is visible for the appropriate include files, and ensuring
that your DLL really does have the manifest resource (open the DLL in
VS to be sure), I'm not aware that you have to do anything else to get
themes to work (though I've never tried with an MMC snap-in)
The following says pretty much the same:
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/userex/cookboo
k.asp?frame=true#mmc
Dave

Signature
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Ismail Pazarbasi - 25 Jul 2005 02:22 GMT
It's not enough to add the manifest in your resource's textinclude, but
you need to add it to your resource.h file as well, if it's not in
there.
David Lowndes - 25 Jul 2005 07:38 GMT
>It's not enough to add the manifest in your resource's textinclude, but
>you need to add it to your resource.h file as well, if it's not in
>there.
Huh?
Please explain what you mean.
Dave

Signature
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Ismail Pazarbasi - 25 Jul 2005 18:38 GMT
I mean:
3 TEXTINCLUDE
BEGIN
"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST
"".\\myapp.exe.manifest""\r\n"
"\0"
END
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ".\myapp.exe.manifest"
in .rc file is not enough to enable visual styles. it also needs
#define IDR_MANIFEST 1
in resource.h
austinf - 25 Jul 2005 20:43 GMT
I know for a fact you can get XP themes to work in an atl dll. I have a
BHO built using ATL that has themes enabled in all of its dialog boxes.
If the host app supports linking in the commctrl dll via the isloation
aware method, then your atl dll should too..
Here is what I did.
1. added
/D ISOLATION_AWARE_ENABLED
to the command line args in the project properties. This is so it is
top level
2. added the standard manifest for common control v6 as a resource type
RT_MANIFEST and changed the id to 2.
3. in resource.h define IDR_MANIFEST to be 2
worked for me
Egbert Nierop (MVP for IIS) - 25 Jul 2005 09:12 GMT
> >What I did:
>>1) #include "commctrl.h"
[quoted text clipped - 11 lines]
> VS to be sure), I'm not aware that you have to do anything else to get
> themes to work (though I've never tried with an MMC snap-in)
Sure I did!
thanks however for the hint.
> The following says pretty much the same:
>
> http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/userex/cookboo
k.asp?frame=true#mmc
>
> Dave
Egbert Nierop (MVP for IIS) - 25 Jul 2005 09:15 GMT
> >What I did:
>>1) #include "commctrl.h"
[quoted text clipped - 15 lines]
>
> http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/userex/cookboo
k.asp?frame=true#mmc
Indeed.
And such as docs suggest. MFC with C++.NET can by design handle themes if
you only add the resource stuff and the flags.
And ATL does not. If somebody can confirm me this, I simply know the next
step.
(Before someone says that ATL is not graphical such as MFC or WTL, I must
slightly disagree, ATL supports MMC snapins).
> Dave
Egbert Nierop (MVP for IIS) - 25 Jul 2005 09:32 GMT
For everybody's knowledge.
If you use ATL, no support for XP Theming is available. (I can't state such
for MFC b.t.w)
Use this
http://www.codeproject.com/w2k/themewrapper.asp
The wrapper is needed after applying the resource manifest to your
executable or DLL
(see
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/userex/cookboo
k.asp?frame=true#mmc)
> >What I did:
>>1) #include "commctrl.h"
[quoted text clipped - 17 lines]
>
> Dave
David Lowndes - 25 Jul 2005 12:22 GMT
>If you use ATL, no support for XP Theming is available.
I can't see how you conclude something like that (other than the fact
that it's apparently not working in your circumstance).
>Use this
>http://www.codeproject.com/w2k/themewrapper.asp
What relevance has that article with ATL? It's title says it's for
owner drawn controls? Do you use an owner drawn control in your ATL
based MMC snap-in?
Dave
Egbert Nierop (MVP for IIS) - 25 Jul 2005 14:57 GMT
> >If you use ATL, no support for XP Theming is available.
>
[quoted text clipped - 5 lines]
>
> What relevance has that article with ATL?
Why ask about relevance. If you know a better group, please tell me.
> It's title says it's for
> owner drawn controls? Do you use an owner drawn control in your ATL
The fact is, that non-owner drawn controls in ATL wont have XP styles.
Another fact is that developers in C# for instance, without a lot of
modification, can support styles and I've red the same about MFC.
ATL is left over. MS should make a clear point about their ATL support like
"ATL development has been frozen since 2000".
Now I'm not 100% sure whether or not I can support themes using the current
code or not.
> based MMC snap-in?
Everything that I meet during development is ATL related.
If I do MFC, I would post it in MFC.
> Dave
Egbert Nierop (MVP for IIS) - 26 Jul 2005 09:04 GMT
>> >If you use ATL, no support for XP Theming is available.
>>
[quoted text clipped - 3 lines]
>>>Use this
>>>http://www.codeproject.com/w2k/themewrapper.asp
Solution:
It has to be defined in resource.h and not in stdafx.h
For some, this might be obvious if the MSDN mentions this, but the MSDN does
only say:
Define a manifest resource ID of 2.
#define MANIFEST_RESOURCE_ID 2 Solution:had to be done in resource.h and not
in stdafx.h.Now it works!
Ismail Pazarbasi - 26 Jul 2005 20:03 GMT
Couple of months ago, I have realized that my application doesn't
support visual styles, even though I have added it into my .rc file.
Then I compared the project's .rc and resource.h files with another
project's ones (written with WTL), which supports visual styles, and I
have seen that IDR_MANIFEST is not defined in former one. This is why I
told you that it's not enough to have manifest in your .rc but you also
need to #define it in your resource.h.
I am not sure why, but, for example, having TYPELIB in .rc file is also
insufficient to embed type library in COM dll, if it's not defined in
resource.h.
May be this is not related to resource IDs, but with resource count.
Because I have defined my manifest resource id 241, and it worked as
well.
Ismail
Egbert Nierop (MVP for IIS) - 27 Jul 2005 12:41 GMT
> Couple of months ago, I have realized that my application doesn't
> support visual styles, even though I have added it into my .rc file.
[quoted text clipped - 11 lines]
> Because I have defined my manifest resource id 241, and it worked as
> well.
I can explain. If you don't define the correct resource_id, the typelibrary
won't be found by Windows by using FindResourceEx(..) or LoadMenu(..)
LoadTypeLib ...etc. A resource id is usedin those parameters.
The C++ compiler does not warn you if you forgot to define a resource id. I
found by opening the DLL in resource edit mode, that the manifest was having
an ID of 0.
Ismail Pazarbasi - 28 Jul 2005 22:48 GMT
in my resource.h:
#define IDR_MYTYPELIB 1111
in my .rc
1 TYPELIB "navigation.tlb"
this works fine. I am not sure whether this is "the correct" way, I
have seen this example on KB. What I don't understand here is the
relationship between IDR_MYTYPELIB and the typelib resource in .rc.
IDR_MYTYPELIB is not used in .rc. Same applies to manifest. I have
changed my manifest id to 241 in .h, it works again, but not used that
name/id in .rc.