473,796 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VC dialogs & XP themes

When I build some add-ins for the management console using C++, the add-ins
made by me show a Win2000 interface while the rest of the add-ins made by MS
are using XP themes.

What am I missing?

Cheers

Nov 17 '05
18 2284
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...frame=true#mmc)

"David Lowndes" <da****@example .invalid> wrote in message
news:l8******** *************** *********@4ax.c om...
What I did:
1) #include "commctrl.h "
2) #define ISOLATION_AWARE _ENABLED 1 (!! if you leave out the 1, it will
not
compile!)3) #define MANIFEST_RESOUR CE_ID 2
In the rc file
MANIFEST_RESO URCE_ID RT_MANIFEST "myDll.dll.mani fest"(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...frame=true#mmc

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq


Nov 17 '05 #11
>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
Nov 17 '05 #12
"David Lowndes" <da****@example .invalid> wrote in message
news:4l******** *************** *********@4ax.c om...
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?


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


Nov 17 '05 #13
I mean:

3 TEXTINCLUDE
BEGIN
"CREATEPROCESS_ MANIFEST_RESOUR CE_ID RT_MANIFEST
"".\\myapp.exe. manifest""\r\n"
"\0"
END
CREATEPROCESS_M ANIFEST_RESOURC E_ID RT_MANIFEST ".\myapp.exe.ma nifest"

in .rc file is not enough to enable visual styles. it also needs

#define IDR_MANIFEST 1

in resource.h

Nov 17 '05 #14
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

Nov 17 '05 #15
"Egbert Nierop (MVP for IIS)" <eg***********@ nospam.invalid> wrote in
message news:uz******** *****@TK2MSFTNG P15.phx.gbl...
"David Lowndes" <da****@example .invalid> wrote in message
news:4l******** *************** *********@4ax.c om...
>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


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_RESOUR CE_ID 2 Solution:had to be done in resource.h and not
in stdafx.h.Now it works!

Nov 17 '05 #16
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

Nov 17 '05 #17
"Ismail Pazarbasi" <pa*******@gmai l.com> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com...
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.


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.

Nov 17 '05 #18
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.

Nov 17 '05 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2608
by: Tim Marshall | last post by:
I would swear that when I developed in A97, I could change the back colour of a form. However, in Windows XP, on both A97 and A2003, there no longer is a property showing in the format tab for form properties for a back colour. I think the themed control idea is pretty good in that a developer can really go out on a limb if s/he chooses all kinds of fancy background colours for his/her app since colours selection is a very subjective...
5
1965
by: Sol | last post by:
Hi Guys, I'm looking for some advice / guidelines on using Themes with an application I am working on. The application needs to allow people to customize the appearance utilizing what I would consider to be a Themeing and Skinning mechanism. What is critical is that this should be as flexible as possible. What I would like to do is use the built-in Themeing mechanism to allow the customization, but as we know, the App_Theme folder...
0
996
by: lew26 | last post by:
I have one page on my site that i do not want to have themes, or stylesheet themes applied to it. How do i disable both. I already know how to disable themes. But how do i disable stylesheetThemes? Code Disable Themes. <%@ Page Language="VB" EnableTheming="false" AutoEventWireup="false" CodeFile="FileManager2.aspx.vb" Inherits="Admin_FileManager_FileManager2" Debug="true" Trace="true" TraceMode="SortByCategory" %>
2
1598
by: Clint Chapman | last post by:
When I look at the source html generated from my asp, the links for the css in my theme are duplicated to include files in the _vti_cnf. <link href="../../App_Themes/MainTheme/_vti_cnf/StyleSheet.css" type="text/css" rel="stylesheet" /> <link href="../../App_Themes/MainTheme/StyleSheet.css" type="text/css" rel="stylesheet" /> I've had problems with my theme not working because there appeared to be too many css files. I was able to...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.