Visual Studio Developer Center > Visual Studio Forums > Visual Studio Debugger > Exception from HRESULT:0X800A7539 error in VB.NET2005

Answered Exception from HRESULT:0X800A7539 error in VB.NET2005

  • Thursday, June 11, 2009 9:10 PM
     
     
    Hi,
    I am getting the error COMException was unhandled when my application is processing the input data from a data file.
    Code extract:
    For n = 1 To 10
    fxgComponentData.Col = n

    fxgComponentData.CellAlignment = 4

     

    fxgComponentData.Text = "Node " & Str(n)

     

    Next n

    Error raised on the Bold line. I upgraded this code from VB6 to VB2005. 
    I hope this is enough information, any clues  will be apreciated.

    Regards,
    Mugu

Answers

  • Thursday, June 18, 2009 4:21 AM
    Moderator
     
     Answered Has Code
    Hello Mugu,

    I'm not sure how many Cols and Rows do you defined for the control, this exception was thrown maybe bacause the current Col index you assigned to the control (fxgComponentData.Col = n in this case) is out of the range of the Cols property.

    Please check the Cols property of the control by openning the ActiveX -Properties window.

    Also, if you try the code snippet below, does the issue still occur?
    int rows = fxgComponentData.Rows;
    int cols = fxgComponentData.Cols;
    for (int i=0; i<rows; i++)
    {
          fxgComponentData.Row = i;
          for(int j=0; j<cols; j++)
          {
                fxgComponentData.Col = j;
                fxgComponentData.Text = "Node "+(j+1).ToString();
          }
    }
    (the code snippet assumed that the control's name is fxComponentData.)

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!

All Replies

  • Thursday, June 11, 2009 11:19 PM
     
     
    Hi,

    What type of object is fxgComponentData? It sounds like the object is experiencing some sort of internal error. Has it been initialised properly, or are some values of 'n' out of range perhaps?

    Jon
    Jonathan Boles - Visual Studio Debugger QA
  • Friday, June 12, 2009 7:02 AM
     
     
    fxgComponentData is a AxMSHFlexGrid, the data is read from the data file into the Grid.
    I'm getting a few of these errors everytime I want to display the data in the grid.
    What is such an error normally associated with (root cause)?

    Tx,
    Mugu
  • Thursday, June 18, 2009 4:21 AM
    Moderator
     
     Answered Has Code
    Hello Mugu,

    I'm not sure how many Cols and Rows do you defined for the control, this exception was thrown maybe bacause the current Col index you assigned to the control (fxgComponentData.Col = n in this case) is out of the range of the Cols property.

    Please check the Cols property of the control by openning the ActiveX -Properties window.

    Also, if you try the code snippet below, does the issue still occur?
    int rows = fxgComponentData.Rows;
    int cols = fxgComponentData.Cols;
    for (int i=0; i<rows; i++)
    {
          fxgComponentData.Row = i;
          for(int j=0; j<cols; j++)
          {
                fxgComponentData.Col = j;
                fxgComponentData.Text = "Node "+(j+1).ToString();
          }
    }
    (the code snippet assumed that the control's name is fxComponentData.)

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!