How do I enable XP Visual styles in Visio 2003 addon ?

B

bnk

Hello, Bill.
Thank you for reply, but I've already tried this.

Exactly, I've added manifest file to the VSL resources, but this does
not work.
resource type=24 (RT_MANIFEST)
resource id=2
I've tried ID=3 too.
ISOLATION_AWARE_ENABLED = 1
The manifest file itself is at the end of this post.

To reproduce this use Visio 2003 Addon wizard to create VSL that uses
nothing.
Then, add the manifest to the resources. This VSL will pop the message
box when ivoked. This message box is not themed..

Hoping for help on this issue,
Nikolay, EiTAM Inc.

Manifest file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
version="4.0.4.1"
processorArchitecture="X86"
name="My.Company.Application"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
 
B

Bill K. [MSFT]

It looks like you are adding the manifest correctly, but using an unthemed
mfc dll (mfc71.dll?). If the mfc dll is not compiled with
ISOLATION_AWARE_ENABLED (plus the manifest for common controls 6) then any
dialogs it displays such as MessageBox will not be themed.
To confirm this you can change MessageBox(args) to ::MessageBoxEx(args) to
bypass the mfc MessageBox implementation.
You could also remove the MessageBox and display a dialog box that is owned
by the vsl and it should theme correctly.

Hope this helps,

--
Bill K.
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.



bnk said:
Hello, Bill.
Thank you for reply, but I've already tried this.

Exactly, I've added manifest file to the VSL resources, but this does
not work.
resource type=24 (RT_MANIFEST)
resource id=2
I've tried ID=3 too.
ISOLATION_AWARE_ENABLED = 1
The manifest file itself is at the end of this post.

To reproduce this use Visio 2003 Addon wizard to create VSL that uses
nothing.
Then, add the manifest to the resources. This VSL will pop the message
box when ivoked. This message box is not themed..

Hoping for help on this issue,
Nikolay, EiTAM Inc.

Manifest file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
version="4.0.4.1"
processorArchitecture="X86"
name="My.Company.Application"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

"Bill K. [MSFT]" <[email protected]> wrote in message
Visio uses an opt-in model for XP themeing, so you will need to add a
manifest resource to your project and specify common controls version 6.

This article has details on how to add a manifest:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/xptheming.asp


Hope this helps,
 
B

bnk

Hello, Bill.
Thank you for assistance.

Can you see, the VSL does not use MFC at all :((i.e. neither MFC nor ATL)...
So this can not be an issue...

Visio 2003 Pro, Win XP Pro..
Does theming work at all for VSL? (may be the problem is in file extension?)
Regards, Nikolay.
 
B

Bill K. [MSFT]

Here are the steps to get themeing working. I just tried it and themeing
worked fine (but not with MessageBox, you need to replace it with
MessageBoxEx, or explicitly call IsolationAwareMessageBox(...).
(Just to be thorough I'll list all the steps).

Create a new dev studio project and select "Visio add-in or add-on".
In the wizard, select "VSL" and "Without ATL or MFC".

After the project is created, click Project > Properties.
In the C++ > Preprocessor form, add ISOLATION_AWARE_ENABLED to the
"Preprocessor Definitions" list (be sure to add it to all configurations).

Copy the manifest file into your project.
Edit the project.rc file (right-click, select "open-with..." and pick
"source code (Text) editor")
Add this line (edit the filename to match your manifest file name):
ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST "VisioProject1.Manifest"

Edit VisioProject1.cpp
change MessageBox(...) to MessageBoxEx(... ,1033) or
IsolationAwareMessageBox(...);

Rebuild the project.


Hope this helps.
--
Bill K.
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


bnk said:
Hello, Bill.
Thank you for assistance.

Can you see, the VSL does not use MFC at all :((i.e. neither MFC nor ATL)...
So this can not be an issue...

Visio 2003 Pro, Win XP Pro..
Does theming work at all for VSL? (may be the problem is in file extension?)
Regards, Nikolay.

"Bill K. [MSFT]" <[email protected]> wrote in message
It looks like you are adding the manifest correctly, but using an unthemed
mfc dll (mfc71.dll?). If the mfc dll is not compiled with
ISOLATION_AWARE_ENABLED (plus the manifest for common controls 6) then any
dialogs it displays such as MessageBox will not be themed.
To confirm this you can change MessageBox(args) to ::MessageBoxEx(args) to
bypass the mfc MessageBox implementation.
You could also remove the MessageBox and display a dialog box that is owned
by the vsl and it should theme correctly.

Hope this helps,
 
B

bnk

Hello, Bill!

The MessageBoxEx() solved this at once :) We're so happy :)
But, the actual project uses MFC... that indeed was not compiled with
ISOLATION_AWARE_ENABLED.. Can this be solved too? What version of mfc
dll should be used to enable theming (if any)?
any dialogs it displays such as MessageBox will not be themed.

Regards, Nikolay.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top