tags:

views:

103

answers:

7

I'm developing a Desktop application. I have a button that upon click calls some webservices.

Problem is when there is no connection or on a slow connection the interface becomes unresponsive and it seems as if the application crashed.

Wonder what are the techniques to get around this

+2  A: 

You can make asynchronous calls to the web service. This means that the GUI doesn't wait for the response.

Burt
+2  A: 

You need to investigate multi-threading.

By creating a thread and performing the processing on that you'll keep the UI responsive.

See this MSDN article for a starting point.

ChrisF
+2  A: 

You could use a thread to make the WS requests, and keep the interface thread free and responsive. You should notify the user when waiting by displaying an appropriate message and a progress indicator. Here's something specific to GTK# UI update.

luvieere
+1  A: 

Use the BackgroundWorker class for calling a webservice.

Davorin
A: 

Also see this FAQ (and answer), especially the talk about GTK+'s "idle" system.

unwind
+1  A: 

I asked something very similar myself. See this post.

BackgroundWorker is your friend!

GenericTypeTea
+3  A: 

You should use BackgroundWorker.

Konstantin Spirin