Error HRESULT E_FAIL has been returned from a call to a COM component

后端 未结 25 1205
情书的邮戳
情书的邮戳 2020-12-24 05:01

In Silverlight 4 app; what does this error mean?:

\"Error HRESULT E_FAIL has been returned from a call to a COM component.\"

It

25条回答
  •  执笔经年
    2020-12-24 05:53

    Here's one way to generate this error, which I stumbled upon today. We have the following button in XAML:

        

    The event handler that handles the button's Click event is as follows:

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            button.Margin = new Thickness(0, double.NaN, 0, 0);
        }
    

    When I click on the button I get the aforementioned error. The same error arises if I replace NaN with PositiveInfinity or NegativeInfinity.

    Interestingly, I get a different error message if the first parameter of the Thickness constructor contains the NaN instead of the second.

提交回复
热议问题