TCPClient -form.show

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I've been using the "Advanced .NET Framework (Networking) - Use Sockets"
example that comes with the "Visual Basic.Net Resource Kit". This works
perfectly fine and i learned alot from it.

However i'm having a problem with showing a Windows Form in the
asynchronous Read procedure in the client application. The form is loaded and
show on screen without error messages however the form screen is painted
plane white. No controls are displayed and the mouse pointer turns to an hour
glass with in the form.

Have u ever tried to intatiate a new form and show it on screen after
receiving a message from TCP Server application? I do not want to use
ShowDialoge as i need multipile forms loaded at the same time.

I've been over a week trying to fix this problem using 101 methods. I have
no idea what else to do. Please HELP!!

Thank you....Andrew
 
However i'm having a problem with showing a Windows Form in the
asynchronous Read procedure in the client application.

This is going to be... tricky.

When you're in the callback from the Async Read, you're running on a
threadpool thread - not your applications main thread. Not the same thread
as your existing message pump is tied to.

You'll need to marshall over to your main thread, (using
Control.BeginInvoke) to do any interesting forms stuff.
 
Thanks my friend. I thought the problem might had to do with threads but i
was not sure. Any code example or source from where i can get this working?

Much appreciated.
Andrew
 
Take a look at the BeginInkove or Invoke procedure at MSDN help.

You can find a good example there. It helped me to solve the problem in an
hour or so.

Andrew
 
thank

Andrew said:
Take a look at the BeginInkove or Invoke procedure at MSDN help.

You can find a good example there. It helped me to solve the problem in an
hour or so.

Andrew



:
 
Back
Top