473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

sending a message to a thread

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
Nov 21 '05 #1
4 1086
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
Nov 21 '05 #2
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

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uc**************@TK2MSFTNGP10.phx.gbl... 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

Nov 21 '05 #3
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
Nov 21 '05 #4
Thanks Cor

Geoff

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uy**************@TK2MSFTNGP14.phx.gbl...
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

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert A. van Ginkel | last post by:
Hello Fellow Developer, I use the System.Net.Sockets to send/receive data (no tcpclient/tcplistener), I made a receivethread in my wrapper, the receivethread loops/sleeps while waiting for data...
11
by: Ron Vecchi | last post by:
I've used System.Web.Mail before but have never had the need to send attchemnets through it...until now. A client of mine would like a form on the website to allow a user to type up a message and...
5
by: BVM | last post by:
Hi: I have a problem when sending large email(more than 20Mb) from a web page. I got timeout error. How to overcome this problem? I am thinking to have a thread to send email. Once the thread...
7
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
9
by: Miro | last post by:
VB 2003 at the end of the code, this works great. bytCommand = Encoding.ASCII.GetBytes("testing hello send text") udpClient.Send(bytCommand, bytCommand.Length) and this recieves it Dim...
3
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the...
0
by: Buddy Home | last post by:
There is two examples of code. Example 1. Send and Receive within the same process. Put this code in a console app called SendAndReceive and run the code. using System; using...
2
by: nautonnier | last post by:
Hello, I have a C# app that spawns several processes each containing a console app written by another developer in C++. The console app was written first to be just like a console app: it...
15
by: colin | last post by:
Hi, Im familiar with c,c++ etc, and Ive spent a week trying to write my first app in c# it works reasonably well, but im having difficulty getting to grips with inter thread signalling etc. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.