Question

What's incorrect in this manifest to run an app as Admin? It works fine with 32-bit, but used with a 64-bit exec gives an error on startup and shuts down: "The application was unable to start correctly (0xc000007b). Click OK to close the application."

EDIT: question solved and closed, for future reference:

Working manifest for both 32/64 bit, add it through Project Options/Application/Runtime Themes/Custom Manifest->pick .manifest file. Delphi XE2 resource compiler seems to mess up otherwise for some reason.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <dependency>
                <dependentAssembly>
                        <assemblyIdentity
                                type="win32"
                                name="Microsoft.Windows.Common-Controls"
                                version="6.0.0.0"
                                processorArchitecture="*"
                                publicKeyToken="6595b64144ccf1df"
                                language="*"
                        />
                </dependentAssembly>
        </dependency>
        <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
                <security>
                        <requestedPrivileges>
                                <requestedExecutionLevel
                                       level="requireAdministrator"
                                       uiAccess="false"/>
                        </requestedPrivileges>
                </security>
        </trustInfo>
</assembly>
Was it helpful?

Solution

Your problem is not related to your manifest. You can verify that this is so by creating an empty application and adding your manifest as a custom manifest.

Error code 0xc000007b is what you get when a 64 bit process imports functions from a 32 bit DLL and this is the most plausible explanation for your woes. Use Dependency Walker to find out which imports are being resolved by 32 bit DLLs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top