2

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>
hikari
  • 3,393
  • 1
  • 33
  • 72
  • related (http://stackoverflow.com/questions/10492037/the-application-was-unable-to-start-correctly-0xc000007b) – Hendra Jun 24 '12 at 04:49

1 Answers1

3

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.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • The application works fine though in 64-bit without the manifest. – hikari Jun 24 '12 at 12:05
  • What did Dependency Walker tell you? – David Heffernan Jun 24 '12 at 12:48
  • Got it working now, somehow the resource compiler (brcc32) was messing something up. If I add the manifest through project options/application/runtime themes->Custom manifest and pick the manifest file manually, it works fine. – hikari Jun 24 '12 at 13:12