Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Cross-thread VB.NET 2008 Communication WITHOUT forms

Avatar of mediasoftware
mediasoftware asked on
.NET ProgrammingVisual Basic.NET
4 Comments1 Solution763 ViewsLast Modified:
Hello, I am developing a VB.NET 2008 application.

Although this is not a console application, this 'Windows Forms Application' consists of only a module (no UI, no Forms, no Controls, no Classes, ONLY a module).

Now, in that module, I call an asynchronous TcpClient BeginRead, passing 'AdressOf DoRead' as CallBack.

When the DoRead sub is executed, it runs on a different thread than the main module, and any call from here on executes on this thread.

What I need is a way to call a sub in the main thread from the CallBack thread (sub DoRead), all this without any UI components or forms.

I want a solution strictly to my problem, not a workaround involving Forms or synchronous read calls.

Thank you.
Avatar of Mike Tomlinson
Mike TomlinsonFlag of United States of America imageHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers