Reputation: 450
I'm trying to port a win32 application that is currently built using the VC98 compiler on command line (not the IDE).
I wish to enable Visual Styles for this application so that the application gets the new themed controls that came with Windows XP.
The way to go I've learnt for this is to use a manifest and specify version 6 of ComCtl32.dll.
Is it possible to do this in my application without upgrading the compiler?
In other words, can we use Visual Studio 6.0 (command line build interface) to specify a manifest file for an application?
Upvotes: 3
Views: 219
Reputation: 50778
Following works for me on VS6:
Simply put this into your .rc file:
1 RT_MANIFEST "manifest.xml"
or if RT_MANIFEST
is not defined:
1 24 "manifest.xml"
Where manifest.xml
is the manifest file which is this in my case:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="1.0.0.0"
type="win32"
name="somename.exe"/>
<description>Some description</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
The important part for comctrl32 6.0 is the <dependency>
part. The <trustinfo>
part is also more or less required nowadays.
Upvotes: 0
Reputation: 612794
A manifest is just a resource. Compile the resource and link it to your executable just like any other resource.
Indeed you don't need to resort to the command line to do this. You are able to link dialog resources, icon resources and so on from the IDE. You can do the same with a manifest resource.
Various options for embedding the resource are described here: How to embed a manifest in an assembly: let me count the ways...
Upvotes: 2