Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asynchronous thread & controls

Status
Not open for further replies.

Jannick

Programmer
Jun 1, 2003
2
BE
Hi,

am playing around with workerthreads in vb.net 2003

I made a small project for testing that i uploaded

in my solution i got 2 projects; 1 for a form and 1 for threadlogic(businessclass if you will)

i was wondering if anyone could tell me if this way of updating the controls is 'allowed' because i'm reading everywhere you're not allowed to set a control in a thread (one which didn't create the controle). Although it seems to work.
The reason im asking is because the helpfile on ISynchronizeInvoke.Invoke it clearly says;
First parameter = A Delegate that contains a method to call, in the context of the thread for the control


Also in the OnComplete-methode i'm having trouble;
Dim dhw works i can't seem to declare the type (invalid cast) because the delegate is in the form-project (i tried copying it into the class but doesn't work, setting a reference to a form-project is not allowed). Anyway around this??

Further i wanted to ask if a reference to system......forms is common in a project that handles threads.

tnx in advance,
Jannick

ps: i just saw/tested my attachment and forgot to mention; open project testingthread and delete the 2 components that arent found ( clsTest and frmMain)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top