473,441 Members | 1,629 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,441 software developers and data experts.

how can i execute a delegate on the thread that created the object ? (object that is not control )

how can i execute a delegate on the thread that created the object ?
(the object is not control, but im looking somthing like the control.invoke
, but to my object)
Nov 17 '05 #1
3 1396
> how can i execute a delegate on the thread that created the object ?
(the object is not control, but im looking somthing like the
control.invoke
, but to my object)


Not sure what do you really mean by "execute delegate on the thread".

Can you provide more details?
--
Cheers,
Gaurav Vaish
http://mastergaurav.org
http://mastergaurav.blogspot.com
-----------------------------


Nov 17 '05 #2
roni wrote:
how can i execute a delegate on the thread that created the object ?
(the object is not control, but im looking somthing like the
control.invoke , but to my object)


I think that's not possible. Control.Invoke() sends a window message to the
control, the message gets picked up in the control's message loop and gets
handled from there. If you have a simple object but no Control or Form, you
have no message loop and thus can't do that.

If you only want to signal another thread that it should start doing
something, you can use the Manual- or AutoResetEvent or Monitor classes.

hth,
Max

Nov 17 '05 #3
roni <xs*******@hotmail.com> wrote:
how can i execute a delegate on the thread that created the object ?
(the object is not control, but im looking somthing like the control.invoke
, but to my object)


Well, what's the other thread doing? It will have to be waiting for you
(or someone else) to ask it to handle your request. You can't just
hijack a thread and tell it to do something if it's in the middle of
doing something else.

Objects don't automatically know which thread they've been created on,
either.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4

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

Similar topics

0
by: Paul Tomlinson | last post by:
Morning all. Let me describe my problem. Main thread creates child objects and threads and starts them Timer on the main thread (which only gets activated after the child threads have started)...
2
by: Nony Buz | last post by:
My objective is simply: Notify a form when a image file has been created in a directory. First there is a basic interface for the callback function: public interface INewImageNotify { void...
0
by: Wavemaker | last post by:
One of the things I've struggled with from time to time is handling events raised on different threads. For example, an object could be listening to events from one or more objects running in...
2
by: roni | last post by:
hi. i have applcation in net. in that application i have 3 threads. 1- main thread with message loop and form 2. thread with message loop and form 3. thread with message loop and form ...
3
by: roni | last post by:
how can i execute a delegate on the thread that created the object ? (the object is not control, but im looking somthing like the control.invoke , but to my object)
9
by: Terry Olsen | last post by:
I'm running an asynchronous Socket. In the ReceiveCallback method, I need to append what is received to a textbox on the main form. I have this code: Private Sub ToChatWindow(ByVal msg As...
5
by: Doug Handler | last post by:
Hi, I have a form (Form1) that contains a tab control which one tab has a customer user control (UserControl1). When the user double-clicks on the grid hosted there a new user control is...
4
by: Erik | last post by:
First, I am not creating any new threads via invoke or any other intentional means. As far as I know, there is just one thread, which is the main thread. My windows form class creates a new...
5
by: jecheney | last post by:
Hi, another thread, Debug_Console is a listbox control on my main form, i created the delegate to avoid the cross threading error. Now the strange thing is, when i call the method from my other...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.