In one of my windows application, I was making use of Domino inerop for accessing document data from lotus notes. Whenever the interop was probed for some bigger response, my application use to be non responsive or hang.Once the call to inerop is done the application was accessible. Users will not know the progress in such scenarios.

You can avoid this by introducing a Background thead. Move all the inerop method calls to a seperate function. On you event handler add a background thread and call the function.

Thread newThread = new Thread(FunctionWithInteropCalls);

newThread.IsBackground = true;


If the thread is marked as a Background thread, the thread will be killed automatically during Application.Exit()

Now if function which is executed by newThread should access windows objects created in the main thread, you will have to handle it. Sample below shown how you can achieve this.

public void AccessMainThreadObj(string value)
if (InvokeRequired
this.Invoke(newAction<string>(AccessMainThreadObj), value); 
    textbox1.Text = value.Substring(2);
   richTextBox2.Text += value;
void FunctionWithInteropCalls()
AccessMainThreadObj("#1 To update textbox1");
AccessMainThreadObj("To update richTextBox2");

 Create a method to update the value of the controls in the form. Basically this function checks whether the current process needs an invoke, if yes comes through the builtin invoke method.