Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,062 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,749 people online right now. Registration is fast and FREE... Join Now!




Using multiple threads

 
Reply to this topicStart new topic

Using multiple threads

lfk523
2 Mar, 2008 - 08:47 PM
Post #1

New D.I.C Head
*

Joined: 1 Mar, 2008
Posts: 18


My Contributions
How can I access a form on a differant thread then the current one being used? I've tried many things.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Using Multiple Threads
2 Mar, 2008 - 08:51 PM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
You cannot access any controls on the GUI from outside the thread that created them, well not directly you cant. If you are using VB.Net, which I imagine you are since you're asking about threads, you can marshal you call, using a delegate, onto the thread which created the GUI controls. I wrote a C# Tutorial on cross thread communication that you might find useful.

Granted it's in C#, but the concept is the same for VB.Net. Are you using something other than VB6, say VB2005 or VB2008?
User is offlineProfile CardPM
+Quote Post

lfk523
RE: Using Multiple Threads
3 Mar, 2008 - 06:01 PM
Post #3

New D.I.C Head
*

Joined: 1 Mar, 2008
Posts: 18


My Contributions
QUOTE(PsychoCoder @ 2 Mar, 2008 - 09:51 PM) *

You cannot access any controls on the GUI from outside the thread that created them, well not directly you cant. If you are using VB.Net, which I imagine you are since you're asking about threads, you can marshal you call, using a delegate, onto the thread which created the GUI controls. I wrote a C# Tutorial on cross thread communication that you might find useful.

Granted it's in C#, but the concept is the same for VB.Net. Are you using something other than VB6, say VB2005 or VB2008?

I'm using VB2005 but can use VB6 just different variations.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Using Multiple Threads
3 Mar, 2008 - 06:04 PM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Since you're using VB2005 I'm moving this to the VB.Net Forum
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 10:38PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month