sending a message to a thread

  • Thread starter Thread starter Geoff Jones
  • Start date Start date
G

Geoff Jones

Hi

Have a form (form1) that starts a thread which has another form within it
(form2). How can I send a message to this thread? For example, how can I
send some text from Form1 to an TextBox in Form2 whilst the thread is
running?

Some example code would be most helpful.

Geoff
 
Geoff,

You can forever set something globally when you use threads, by instance in
a shared class and use that by instance queues.

However know that using two forms in seperated threads at the same time is
not save.

Why would you do it by the way. The user can only look to and type in one at
a time.

Your processes can you set of course in seperated threads.

I hope this helps,

Cor
 
Hi Cor

I must be honest and admit that I don't understand what you mean by:
You can forever set something globally when you use threads, by instance
in a shared class and use that by instance queues

Why is using two forms in seperate threads a bad idea? I'm interested to
know.

Sorry to bother you.

Geoff
 
Geoff,

A shared class is the same as a module (all members of a module are shared).
Those members you can get in every thread in an apllication.

Therefore when you set something in thread from module A a in a member of
module B, you can read that in moduleB.

About the threath safety of a form. In that I only repeat what I have often
readed in this newsgroup and what I am myself still in doubt about, however
as long as I am in doubt I cannot give you this message without telling you
that.

I hope this helps

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top