473,396 Members | 2,076 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,396 software developers and data experts.

how to post message to other thread in vs.net ?

how , can i post message to other thread in net ?
is there somthing with net that i can do ?
or i need 2 use win32 api's ?
Jul 21 '05 #1
3 1165
Normal event handling should do it.

Just subscribe to the event and process it.

"Daylor" <ro******@hotmail.com> wrote in message
news:bs**********@news2.netvision.net.il...
how , can i post message to other thread in net ?
is there somthing with net that i can do ?
or i need 2 use win32 api's ?

Jul 21 '05 #2
Maybe I did something wrong here. But with following
code, the message is not posted.

public delegate void TestEvtHdr();
public event TestEvtHdr TestEvt;
....
this.TestEvt += new TestEvtHdr(Form1_TestEvt);
....
private void button1_Click()
{
TestEvt();
int j = 0;
for(int i = 1; i < 100; i++)
{
if ((j % 4) != 0)
{
j += i;
}
}
}
private void Form1_TestEvt()
{
int i = 1;
}

That is, by clicking on the button, the callstack become:
W3.Form1.Form1_TestEvt() W3.Form1.button1_Click()
W3.Form1.Main()

-----Original Message-----
Normal event handling should do it.

Just subscribe to the event and process it.

"Daylor" <ro******@hotmail.com> wrote in message
news:bs**********@news2.netvision.net.il...
how , can i post message to other thread in net ?
is there somthing with net that i can do ?
or i need 2 use win32 api's ?

.

Jul 21 '05 #3
Bob
You did nothing wrong, an event is not asynchronous.
What you want and what I've beeing trying to do myself is
to send the data to the thread from the main thread and
let both continue there work. With Win32 you just need to
use PostThreadMessage, what would be the equivalent
implementation on .NET? I was thinking of maybe using a
Win32 event object but that would not be the same. If
somebody can help please let us know.

Bob
-----Original Message-----
Maybe I did something wrong here. But with following
code, the message is not posted.

public delegate void TestEvtHdr();
public event TestEvtHdr TestEvt;
....
this.TestEvt += new TestEvtHdr(Form1_TestEvt);
....
private void button1_Click()
{
TestEvt();
int j = 0;
for(int i = 1; i < 100; i++)
{
if ((j % 4) != 0)
{
j += i;
}
}
}
private void Form1_TestEvt()
{
int i = 1;
}

That is, by clicking on the button, the callstack become:
W3.Form1.Form1_TestEvt()

W3.Form1.button1_Click()
W3.Form1.Main()

-----Original Message-----
Normal event handling should do it.

Just subscribe to the event and process it.

"Daylor" <ro******@hotmail.com> wrote in message
news:bs**********@news2.netvision.net.il...
how , can i post message to other thread in net ?
is there somthing with net that i can do ?
or i need 2 use win32 api's ?

.

.

Jul 21 '05 #4

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

Similar topics

11
by: Ziaran _ | last post by:
I have written a new debugger. I think people will find it useful. Where can I post it for people to download? Thanks, Nir _________________________________________________________________...
0
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
4
by: Daylor | last post by:
how , can i post message to other thread in net ? is there somthing with net that i can do ? or i need 2 use win32 api's ?
0
by: BergRD | last post by:
For some odd reason my original post was double posted then removed from the forums. Odd happenings but wanted to re-post incase no one saw the original, thanks :D > Salutations! > > New to...
3
by: Daylor | last post by:
how , can i post message to other thread in net ? is there somthing with net that i can do ? or i need 2 use win32 api's ?
24
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button...
9
by: c676228 | last post by:
Hi, I am new to this discussion forum. I started to post questions on this forum since this Jan. and got many good responses and I am very appreciated to those who are willing to help with their...
2
by: Phlip | last post by:
Newsgroupies: One myth about USENET is that each group has a charter; some "official" list of on-topic concepts. When a post arrives "violating" this myth, the replies that support the myth can...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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...

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.