0

I am developing a Windows 8 app in which I have to show a message alert. I am using a message dialog box. It gives me this error:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

in my Windows 8 app when calling msgDialogBox.ShowAsync();. Why?

MessageDialog msgDialogBox = new MessageDialog("My message");
UICommand okBtn = new UICommand("OK");
okBtn.Invoked = OkBtnClick;
msgDialogBox.Commands.Add(okBtn);

//Cancel Button
UICommand cancelBtn = new UICommand("Cancel");
cancelBtn.Invoked = CancelBtnClick;
msgDialogBox.Commands.Add(cancelBtn);
await msgDialogBox.ShowAsync();
chue x
  • 18,573
  • 7
  • 56
  • 70
Shikha
  • 29
  • 2
  • Are you developing a Windows Store app or a desktop app? And what "message dialog" are you using? [This one](http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.popups.messagedialog)? Please [edit] your question to show the code you have. – Cody Gray - on strike Aug 17 '13 at 06:22
  • dup of http://stackoverflow.com/questions/12839772/getting-access-is-denied-exception-from-hresult-0x80070005-e-accessdenied – Farhan Ghumra Aug 17 '13 at 07:32
  • I tried this link but of no use.Still I get the same error. – Shikha Aug 17 '13 at 07:48
  • You can show only one message box at a time. You'll have to write the code to ensure you can't display another one, that's going to be "access denied". Please use google to find answers to questions like this, the obvious query is "message dialog access denied". The first hit takes you to: – Hans Passant Aug 17 '13 at 11:14

0 Answers0