locked
MessageDialog.ShowAsync() exception: Error HRESULT E_FAIL has been returned from a call to a COM component

    Question

  • The following code occasionally generates the exception:

    MessageDialog md = new MessageDialog(sMessage);
    md.DefaultCommandIndex = 1;
    await md.ShowAsync();
    Though it is not a serious issue, I am curious about the possible causes of this exception. 


    Hong

    Wednesday, September 24, 2014 1:36 PM

Answers

  • I also have seen this. I recommend that you try/catch and ignore the exception for now.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Hong (MA, USA) Wednesday, September 24, 2014 7:18 PM
    Wednesday, September 24, 2014 7:15 PM
    Moderator

All replies

  • I also have seen this. I recommend that you try/catch and ignore the exception for now.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Hong (MA, USA) Wednesday, September 24, 2014 7:18 PM
    Wednesday, September 24, 2014 7:15 PM
    Moderator
  • Thanks. I will do as you suggest.  If you happen to have any clue about this exception, please kindly share it here. 

    Hong

    Wednesday, September 24, 2014 7:20 PM