locked
invoke throw exception RRS feed

  • Question

  • Dear all,

    I have below code but don't know why when idle for somethime, the below code throw exception.

    Do you know how to solve it??


    beginCB = new beginPOSCallBack(beginPOS);

    public void init()
    {
     try
     {
      this.Invoke(beginCB, new object[] { ErrorVO.OK });
    // Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
     at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
       at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
       at login.init()

     }
     catch(Exception ex)
     {
      //write log
     }
    ....
    }

    Monday, November 5, 2012 8:21 AM

Answers