开发者

issues regarding UAC prompt

开发者 https://www.devze.com 2023-01-02 19:03 出处:网络
I want to implement a UAC prompt for an application in visualc++ the operating system is 32bit x7460(2processor)

I want to implement a UAC prompt for an application in visualc++ the operating system is 32bit x7460(2processor) Windowsserver 2008 the exe is myproject.exe through manifest..

Here for testing i wl build the application in Windows XP OS and copy the exe in to s开发者_JS百科ystem containg the Windowsserver vistamachine and replace it

So what i did is


I seem to recall that support for the manifest was quite flaky in Visual Studio 2005 -- it was much improved in VS2008 (though when you convert the project into 2008 you have to manually check the manifest changes it made). I would suggest not using the manifest option in the project. Instead create a post build step to embed the resource manually using the mt tool - eg see this example.

The mt tool also allows you to check the validity of the manifest. If you have the option to upgrade to VS2008 though then that is well worth doing.


Try disabling the manifest tool in the project settings. In Visual Studio 2005 you can get an emdebbed manifest with the above .rc file changes. You manifest XML for UAC seems correct.

Visual Studio 2005 did not have any built-it support for embedded manifests in the resources view, but Visual Studio 2008 does.


What exactly do you mean with "implement a UAC prompt"? IF you want your application to require administrator rights, embeding or adding the manifest is the right way to go.

You probably got the error that it failed to load the manifest because you have to specifiy include directories for resource seperately. Make sure that the folder which contains your manifest is included in the resource include paths (Right click on project -> properties -> Resources -> Additional include directories). Please note that it is not possible to elevate the rights for an already running process.

If you want to trigger an UAC prompt from a certain point in your application, there is a way to do this using this technique: http://msdn.microsoft.com/en-us/library/ms679687(VS.85).aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消