Follow in Twitter & Facebook



Like in Facebook

Powered By Blogger Widgets

Free Download

FREE Tools



Tuesday, April 24, 2012

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

Introduction:
Here we will discuss about one error which i got while doing one Windows Forms application by Vb.Net. The error is like'Error HRESULT E_FAIL has been returned from a call to a COM component'.

Description:
I got this error "Error HRESULT E_FAIL has been returned from a call to a COM component" while doing just one demo windows application using Vb.Net.When i clicked the Form2.vb[design] tab in visual studio 2010, i got this error.At that time in that same project i had two forms, Form1 and Form2.
After that i cannot able to see that form design. I can only able to see that error at that time.But i can able to run the application its also giving that actual output. Only thing is that i cannot able to see that design page i.e that form2.

But at that time i can able to see the form1 design page properly. 
At that time my code was like below: This is Form2.vb

Public Class Form2
    Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click
        If cmbCourse.SelectedIndex <> -1 Then
            txtCourse.Text = cmbCourse.SelectedItem.ToString()
        End If
    End Sub
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '' cmbCourse.Items.Add("C#.Net")
        '' cmbCourse.Items.Add("Asp.Net")
        ''cmbCourse.Items.Add("Vb.Net")
        Dim arr As New ArrayList()
        arr.Add("C#.Net")
        arr.Add("Asp.Net")
        arr.Add("Vb.Net")
        cmbCourse.DataSource = arr
    End Sub
End Class
Then after i just close that design page i.e Form2.vb[Design] and open that page again, Now no Error. I am sharing the screenshot of that error as below...




0 on: "Error HRESULT E_FAIL has been returned from a call to a COM component."