Click here to Skip to main content
15,892,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Sharing memory between dll and application with HeapAlloc ? Pin
Luc Pattyn6-Dec-09 8:07
sitebuilderLuc Pattyn6-Dec-09 8:07 
GeneralRe: Sharing memory between dll and application with HeapAlloc ? Pin
yarp6-Dec-09 10:06
yarp6-Dec-09 10:06 
QuestionWebBrowser control error INET_E_DOWNLOAD_FAILURE Pin
navinavi6-Dec-09 6:04
navinavi6-Dec-09 6:04 
AnswerRe: WebBrowser control error INET_E_DOWNLOAD_FAILURE Pin
2249176-Dec-09 19:23
2249176-Dec-09 19:23 
AnswerRe: WebBrowser control error INET_E_DOWNLOAD_FAILURE Pin
Sarath C7-Dec-09 0:46
Sarath C7-Dec-09 0:46 
AnswerRe: WebBrowser control error INET_E_DOWNLOAD_FAILURE Pin
navinavi7-Dec-09 1:13
navinavi7-Dec-09 1:13 
QuestionHow to run an app in admin mode in Vista and 7 Pin
Patcher326-Dec-09 3:12
Patcher326-Dec-09 3:12 
AnswerRe: How to run an app in admin mode in Vista and 7 Pin
krmed6-Dec-09 4:57
krmed6-Dec-09 4:57 
It's not the application that detects if you're running as admin or not, it's the OS. Any user of Vista/Windows 7 (including Administrator) by default do not run with admin privilege - it must be requested.

Certain actions require admin rights - like writing to HKEY_LOCAL_MACHINE in the registry or creating files within the Program Files directory (and sub-directories).,

You can make your app show that UAC dialog and request admin rights by using the following manifest file.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
   <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="YourApp" type="win32"/>
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
      <security>
         <requestedPrivileges>
            <requestedExecutionLevel level="requireAdministrator"/> 
         </requestedPrivileges>
      </security>
   </trustInfo>
</assembly>


Save this file in the folder containing your app with the same name as your app and the extension of .manifest.

For instance, if your app is called MyTestApp.exe, save this file as MyTestApp.exe.manifest. Now when you run the app it will pop up the UAC dialog.

Hope that helps.

Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

AnswerRe: How to run an app in admin mode in Vista and 7 Pin
«_Superman_»6-Dec-09 4:58
professional«_Superman_»6-Dec-09 4:58 
AnswerRe: How to run an app in admin mode in Vista and 7 Pin
Kushagra Tiwari6-Dec-09 19:34
Kushagra Tiwari6-Dec-09 19:34 
GeneralRe: How to run an app in admin mode in Vista and 7 Pin
Patcher3230-Apr-10 11:50
Patcher3230-Apr-10 11:50 
QuestionHow to disable/enable menu items when using CMFCMenuBar in Visual Studio 2008 Feature Pack Pin
Blade_Bao5-Dec-09 20:51
Blade_Bao5-Dec-09 20:51 
AnswerRe: How to disable/enable menu items when using CMFCMenuBar in Visual Studio 2008 Feature Pack Pin
krmed6-Dec-09 5:08
krmed6-Dec-09 5:08 
QuestionRe: How to disable/enable menu items when using CMFCMenuBar in Visual Studio 2008 Feature Pack Pin
Blade_Bao12-Dec-09 1:53
Blade_Bao12-Dec-09 1:53 
QuestionSHGetSpecialFolderPath or SHGetFolderPath Pin
includeh105-Dec-09 9:39
includeh105-Dec-09 9:39 
AnswerRe: SHGetSpecialFolderPath or SHGetFolderPath Pin
LunaticFringe5-Dec-09 9:52
LunaticFringe5-Dec-09 9:52 
GeneralRe: SHGetSpecialFolderPath or SHGetFolderPath Pin
Bram van Kampen5-Dec-09 14:28
Bram van Kampen5-Dec-09 14:28 
GeneralRe: SHGetSpecialFolderPath or SHGetFolderPath PinPopular
David Crow5-Dec-09 17:21
David Crow5-Dec-09 17:21 
AnswerRe: SHGetSpecialFolderPath or SHGetFolderPath PinPopular
Iain Clarke, Warrior Programmer5-Dec-09 21:04
Iain Clarke, Warrior Programmer5-Dec-09 21:04 
QuestionWhere to call AnimateWindow during DoModal Pin
emmmatty15-Dec-09 0:27
emmmatty15-Dec-09 0:27 
AnswerRe: Where to call AnimateWindow during DoModal Pin
«_Superman_»5-Dec-09 4:55
professional«_Superman_»5-Dec-09 4:55 
QuestionApplication hangs when entering dialog procedure Pin
Sauce!4-Dec-09 22:32
Sauce!4-Dec-09 22:32 
AnswerRe: Application hangs when entering dialog procedure Pin
Sauce!5-Dec-09 3:43
Sauce!5-Dec-09 3:43 
QuestionSHGetSpecialFolderPath Pin
includeh104-Dec-09 22:15
includeh104-Dec-09 22:15 
AnswerRe: SHGetSpecialFolderPath Pin
MsmVc4-Dec-09 23:44
MsmVc4-Dec-09 23:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.