1

I am using WebBrowser control on a WinForm. When my form is minimized the control throws an exception,

An outgoing call cannot be made since the application is dispatching an input-synchronous call. (Exception from HRESULT: 0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))

I have stated windowstate as,

this.WindowState = FormWindowState.Minimized;

Does anyone aware of this issue ?

Thanks in advance,
Vijay

4

1 回答 1

0

您想从其他线程修改 UI 的地方使用调用方法

        if (control.InvokeRequired)
        { 
            control.Invoke( (MethodInvoker)( ()=> control.updatingfunction() ) ;

        }
        else
        {
            control.updatingfunction();
        }

假设您想对其他线程隐藏一个面板(名为 panel1)。然后你的代码将是

       if (panel1.InvokeRequired)
        { 
            panel1.Invoke( (MethodInvoker)( ()=> panel1.Hide() )) ;

        }
        else
        {
            panel1.Hide();
        }
于 2012-06-02T13:05:20.527 回答