?
Solved

What are the 1, 2, 3 sections in the Windows .rc file? (Related to adding an App.exe.manifest)

Posted on 2009-04-02
11
Medium Priority
?
1,014 Views
Last Modified: 2013-12-03
Hi,

I am facelifting the old application (C++, native code) -- literally, adding the "new" visual appearance known from XP and Vista enabled applications.

I have found the following elsewhere in the Microsoft documentation...

     Add the manifest to your application's resource file as follows:
     CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "App.exe.manifest"

(By the way, do you prefer to keep the convention for naming the manifest file App.exe.manifest? Isn't the App.manifest more appropriate?)

So, wrote the manifest and added it via the above command into the App.rc file. However, I did not find how exactly (to what section or using what tools) I should do it. Therefore, I just put the line via text editor near the beginning of the file.

When observing the resources via the Resource View panel inside VS 2008, I can see that the RT_MANIFEST "folder" was added and it contains the item "2". After some other work with the .rc file and after saving it, I could observe that the line

CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "App.exe.manifest"

was converted to

2 RT_MANIFEST "App.exe.manifest"

My question is: Which way should the CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "App.exe.manifest" be put into .rc (more correctly)? What are the numbered parts of the .rc file?

Thanks,
   Petr
0
Comment
Question by:pepr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
11 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 2000 total points
ID: 24055396
That is the numeric ID of the resource. Resources can be identified by a string of text or an integer number. See:
   FindResource Function
   http://msdn.microsoft.com/en-us/library/ms648042.aspx
The value 2 (ISOLATIONAWARE_MANIFEST_RESOURCE_ID) has special significance, in how the resource manager locates the data.  See:
   http://blogs.msdn.com/junfeng/archive/2007/06/26/rt-manifest-resource-and-isolation-aware-enabled.aspx
These special codes are #DEFINE'd in WinUser.h

0
 
LVL 29

Author Comment

by:pepr
ID: 24058686
Thanks, Dan, for the info. I clearly need to learn that. On the other hand, I would like to solve the following situation quickly.

The main reason I am asking the question is that I am not able to enhance the visual style of the application so that it would work both on Windows Vista and Windows XP. On Vista, if I do not add the manifest file, the look is "the classic one" with sharp rectangular, not shaded buttons, etc. Then the application runs on Vista, on XP, and on Win 2000. When I add the manifest, it runs only on Windows Vista and not on XP (Win2000 not tested for that). Apparently, I am doing something wronly (and that is because I do not understand it).

 I have added the 2 RT_MANIFEST "Market.manifest" line (see below and/or the attached Market.rc file) by hand (text editor). It is likely that it is placed wrongly in the .rc file.


====================================================================
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"

2 RT_MANIFEST "Market.manifest"

(continues)
====================================================================

The code snippet contains the exact content of the manifest file. The attached files show the almost full content of the .rc and .rc2 files.

Thanks for any help,
    Petr


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <description>APS Marketing 3</description>
    <!-- Identify the application security requirements (Vista): -->
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel
                    level="asInvoker"
                    uiAccess="false"
                />
            </requestedPrivileges>
         </security>
    </trustInfo>
    <!-- Activate Windows Common Controls v6 usage (XP and Vista): -->
    <dependency>
        <dependentAssembly>
            <assemblyIdentity 
                type="win32" 
                name="Microsoft.Windows.Common-Controls" 
                version="6.0.0.0"
                processorArchitecture="X86" 
                publicKeyToken="6595b64144ccf1df" 
                language="*" 
            />
        </dependentAssembly>
    </dependency>
</assembly>

Open in new window

Market.rc.txt
Market.rc2.txt
0
 
LVL 29

Author Comment

by:pepr
ID: 24084336
Many thanks, CoolleoMod and DanRollins. ;)

Petr
0
 
LVL 29

Author Closing Comment

by:pepr
ID: 31565705
Not complete, but the good answer, anyway. Having full pocket of point,... enjoy ;)
0
 
LVL 29

Author Comment

by:pepr
ID: 24155361
to modus_operandi: No need for apology. Thanks for the help. The answer by DanRollins still leads to the sources. Thanks again.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question