views:

61

answers:

3

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 system containg the Windowsserver vistamachine and replace it

So what i did is

+2  A: 

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.

the_mandrill
No i should use Visualstudio 2005 itself
peter
I dont know why this much syntax error is comin
peter
I would strongly advise not using VS2005 directly -- I had a lot of problems when I was trying to get a component working that needed to elevate. Doing it in a post-build step is safer IMO. To get to the bottom of your particular issue it sounds like the file just can't be found, so perhaps it's looking in a different folder, eg the project root rather than the source folder. Try running Process Monitor and then filter for 'path contains .manifest' which will show you where it's looking for the file.
the_mandrill
A: 

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

humbagumba
Yes you are correct i created manifest in desktop and added it in project.Now i included it in project and did theway you mentioned added it in "Additional include directories"So that general error overBut still i am getting so many syntax error.is there any problem when iadded line of code in Myproject.hwhen i commented it #define MANIFEST_RESOURCE_ID 1MANIFEST_RESOURCE_ID RT_MANIFEST "myproject.exe.manifest" i cant see any error
peter
As Hans already wrote above, we will need to see those syntax errors otherwise we won't be able to help.
humbagumba
How to disable manifest tool in the project settings,Is it required
peter
+1  A: 

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.

Taneli Waltari
i am getting so many syntax error.is there any problem when iadded line of code in Myproject.hwhen i commented it #define MANIFEST_RESOURCE_ID 1MANIFEST_RESOURCE_ID RT_MANIFEST "myproject.exe.manifest" i cant see any error
peter
I am C# guy i dont know about c++ that what the thing.but this project contain c,c++,c#
peter
How to disable manifest tool in the project settings,Is it required
peter
Lot of errors in all parts in the project which i didnt touched yet like syntax error : 'public' \\\Myproject.cpp 28 missing type specifier - int assumed. Note: C++ does not support default-int \MyprojectDlg.cpp
peter
thats my problem i added space in macro
peter
Taneli Waltari