user525717
user525717

Reputation: 1652

Asking admin rights c++ windows

Im very new in C++

I have found this post http://msdn.microsoft.com/en-us/magazine/cc163486.aspx and trying to ask admin right to windows.

I have created .manifest file added this

#define MANIFEST_RESOURCE_ID 1
MANIFEST_RESOURCE_ID RT_MANIFEST "MyAPP.exe.manifest"

To my main.cpp under #includes

visual studio says: expected a declaration.

What i am doing wrong?

Thanks

Upvotes: 0

Views: 372

Answers (1)

MerickOWA
MerickOWA

Reputation: 7592

As it states in the link you provided:

The following lines in the .rc file would embed the manifest above if it were saved as Ad­min­App.exe.man­ifest:

#define MANIFEST_RESOURCE_ID 1
MANIFEST_RESOURCE_ID RT_MANIFEST "AdminApp.exe.manifest"

Your C++ project needs a resource file, and these lines belong in the .rc file, not your main.cpp

Don't forget to create your manifest file too.

Upvotes: 1

Related Questions