473,549 Members | 3,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to create thread with callback

How does .NET in VC++ create a new thread. I need to be able to run a
procedure within a thread that will notify me when that procedure is done so
that I can continue with the next procedure. I can't go to the next
procedure until the first one is completely through. I believe it is called
a callback.

Daniel
Jul 19 '08 #1
7 2222

System : :Threading namespace

Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:Op******** ******@TK2MSFTN GP04.phx.gbl...
How does .NET in VC++ create a new thread. I need to be able to run a
procedure within a thread that will notify me when that procedure is done
so that I can continue with the next procedure. I can't go to the next
procedure until the first one is completely through. I believe it is
called a callback.

Daniel

Jul 19 '08 #2
What is it called when I have the thread notify me that it's done? In
visual basic it's called raising an event. Win32 API calls it callback. I
need to know how to do that. I need to have a word to search the MSDN
documentation.

Daniel

"Carlos" <a@b.cwrote in message
news:u3******** ******@TK2MSFTN GP06.phx.gbl...
>
System : :Threading namespace

Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:Op******** ******@TK2MSFTN GP04.phx.gbl...
>How does .NET in VC++ create a new thread. I need to be able to run a
procedure within a thread that will notify me when that procedure is done
so that I can continue with the next procedure. I can't go to the next
procedure until the first one is completely through. I believe it is
called a callback.

Daniel


Jul 19 '08 #3

this could help you, process.waitfor exit();
its placed on system :: diagnostics namespace, its clearly independent
of threads creation, u can conbine its use with threads so you obtain
parallel processes working at the same time.
I ve used all I say only once, so take care please.
hope this helps, Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:ub******** ******@TK2MSFTN GP03.phx.gbl...
What is it called when I have the thread notify me that it's done? In
visual basic it's called raising an event. Win32 API calls it callback.
I need to know how to do that. I need to have a word to search the MSDN
documentation.

Daniel

"Carlos" <a@b.cwrote in message
news:u3******** ******@TK2MSFTN GP06.phx.gbl...
>>
System : :Threading namespace

Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:Op******* *******@TK2MSFT NGP04.phx.gbl.. .
>>How does .NET in VC++ create a new thread. I need to be able to run a
procedure within a thread that will notify me when that procedure is
done so that I can continue with the next procedure. I can't go to the
next procedure until the first one is completely through. I believe it
is called a callback.

Daniel



Jul 19 '08 #4
excuseme, now I have not my things here, I cant verify
I used what I ve told u.

"Carlos" <a@b.cescreve u na mensagem
news:Om******** ******@TK2MSFTN GP06.phx.gbl...
>
this could help you, process.waitfor exit();
its placed on system :: diagnostics namespace, its clearly independent
of threads creation, u can conbine its use with threads so you obtain
parallel processes working at the same time.
I ve used all I say only once, so take care please.
hope this helps, Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:ub******** ******@TK2MSFTN GP03.phx.gbl...
>What is it called when I have the thread notify me that it's done? In
visual basic it's called raising an event. Win32 API calls it callback.
I need to know how to do that. I need to have a word to search the MSDN
documentatio n.

Daniel

"Carlos" <a@b.cwrote in message
news:u3******* *******@TK2MSFT NGP06.phx.gbl.. .
>>>
System : :Threading namespace

Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:Op****** ********@TK2MSF TNGP04.phx.gbl. ..
How does .NET in VC++ create a new thread. I need to be able to run a
procedure within a thread that will notify me when that procedure is
done so that I can continue with the next procedure. I can't go to the
next procedure until the first one is completely through. I believe it
is called a callback.

Daniel



Jul 19 '08 #5
Perhaps this code could help u

ProcessStartInf o ^prData;
prData = new ProcessStartInf o();
prData->Verb = "open";
prData->FileName = "c:\\file.t xt";
Process ^pr = Process::Start( prInfo);

.... I havent a compiler now, I believe from here
you can call pr::Waitforexit ( ) the way u want

Carlos.

"Carlos" <a@b.cescreve u na mensagem
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
excuseme, now I have not my things here, I cant verify
I used what I ve told u.

"Carlos" <a@b.cescreve u na mensagem
news:Om******** ******@TK2MSFTN GP06.phx.gbl...
>>
this could help you, process.waitfor exit();
its placed on system :: diagnostics namespace, its clearly independent
of threads creation, u can conbine its use with threads so you obtain
parallel processes working at the same time.
I ve used all I say only once, so take care please.
hope this helps, Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:ub******* *******@TK2MSFT NGP03.phx.gbl.. .
>>What is it called when I have the thread notify me that it's done? In
visual basic it's called raising an event. Win32 API calls it callback.
I need to know how to do that. I need to have a word to search the MSDN
documentation .

Daniel

"Carlos" <a@b.cwrote in message
news:u3****** ********@TK2MSF TNGP06.phx.gbl. ..

System : :Threading namespace

Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:Op***** *********@TK2MS FTNGP04.phx.gbl ...
How does .NET in VC++ create a new thread. I need to be able to run a
procedure within a thread that will notify me when that procedure is
done so that I can continue with the next procedure. I can't go to
the next procedure until the first one is completely through. I
believe it is called a callback.
>
Daniel
>






Jul 19 '08 #6
wrong copy-paste on last post

ProcessStartInf o ^prData;
prData = gcnew ProcessStartInf o();
prData->Verb = "open";
prData->FileName = "c:\\file.t xt";
Process ^pr = Process::Start( prData);

"Carlos" <a@b.cescreve u na mensagem
news:OW******** ******@TK2MSFTN GP02.phx.gbl...
Perhaps this code could help u

ProcessStartInf o ^prData;
prData = new ProcessStartInf o();
prData->Verb = "open";
prData->FileName = "c:\\file.t xt";
Process ^pr = Process::Start( prInfo);

... I havent a compiler now, I believe from here
you can call pr::Waitforexit ( ) the way u want

Carlos.

"Carlos" <a@b.cescreve u na mensagem
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>excuseme, now I have not my things here, I cant verify
I used what I ve told u.

"Carlos" <a@b.cescreve u na mensagem
news:Om******* *******@TK2MSFT NGP06.phx.gbl.. .
>>>
this could help you, process.waitfor exit();
its placed on system :: diagnostics namespace, its clearly independent
of threads creation, u can conbine its use with threads so you obtain
parallel processes working at the same time.
I ve used all I say only once, so take care please.
hope this helps, Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:ub****** ********@TK2MSF TNGP03.phx.gbl. ..
What is it called when I have the thread notify me that it's done? In
visual basic it's called raising an event. Win32 API calls it
callback.
I need to know how to do that. I need to have a word to search the
MSDN
documentatio n.

Daniel

"Carlos" <a@b.cwrote in message
news:u3***** *********@TK2MS FTNGP06.phx.gbl ...
>
System : :Threading namespace
>
Carlos.
>
"Daniel" <ne******@cable one.netescreveu na mensagem
news:Op**** **********@TK2M SFTNGP04.phx.gb l...
>How does .NET in VC++ create a new thread. I need to be able to run
>a
>procedur e within a thread that will notify me when that procedure is
>done so that I can continue with the next procedure. I can't go to
>the next procedure until the first one is completely through. I
>believe it is called a callback.
>>
>Daniel
>>
>
>






Jul 19 '08 #7
Daniel wrote:
What is it called when I have the thread notify me that it's done? In
visual basic it's called raising an event. Win32 API calls it
callback. I need to know how to do that. I need to have a word to
search the MSDN documentation.
Try BackgroundWorke r class.
>
Daniel

"Carlos" <a@b.cwrote in message
news:u3******** ******@TK2MSFTN GP06.phx.gbl...
>>
System : :Threading namespace

Carlos.

"Daniel" <ne******@cable one.netescreveu na mensagem
news:Op******* *******@TK2MSFT NGP04.phx.gbl.. .
>>How does .NET in VC++ create a new thread. I need to be able to
run a procedure within a thread that will notify me when that
procedure is done so that I can continue with the next procedure. I
can't go to the next procedure until the first one is completely
through. I believe it is called a callback.

Daniel

Jul 21 '08 #8

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

Similar topics

3
3360
by: Travis Berg | last post by:
I'm running into a problem when trying to perform a callback to a Python function from a C extension. Specifically, the callback is being made by a pthread that seems to cause the problem. If I call the callback from the parent process, it works fine. The PyObject is static, and holds the same value in both Parent and thread, so I'm at a...
1
7126
by: scott ocamb | last post by:
hello I have implemented a solution using async methods. There is one async method that can be invoked multiple times, ie there are multiple async "threads" running at a time. When these threads are complete, the call the Callback method. Each "thread" calls the same callback method. What thread does this callback method exist on? My...
31
2449
by: AlexeiOst | last post by:
Everywhere in documentation there are recommendations to use threads from thread pooling for relatively short tasks. As I understand, fetching a page or multiple pages (sometimes up to 50 but not tipical) from the Internet and doing some processing on those would be considered to be a big/long task for a thread from a pool. In our app it is...
1
2610
by: johnny | last post by:
In a multi-threaded application, say a worker thread makes an asynchronous call and specifies a callback method. But before the callback is executed, the thread is aborted by its creator. What is the expected behavior for this scenario? Does the thread stay alive until the callback is executed? If an exception is thrown, can it be caught? ...
8
2380
by: Mountain Bikn' Guy | last post by:
I'm using async delegate calls. I would like to re-enter my initial thread after the callback. (I'm not using UI controls, so Control.Invoke is not the solution.) How can I manually implement behavior like Control.Invoke? How can I re-enter my initial thread? Any suggestions? Thanks! Mountain I already searched Google Groups and found...
9
2291
by: Marc Miller | last post by:
Hi all, I have 2 dev. machines, the 1st is Win 2000 with .NET 7.0 and the 2nd is XP Pro with .NET 2003. My Web Server is Win 2000 Server with IIS 5.0. I can create a new project on my test server from the 1st machine, but I receive an 'HTTP/1.1 500 Internal Server error" from my Web Server. My userid/password are the same on all 3...
7
3217
by: Roemer | last post by:
Hi all I stumbled over a new problem: I have a programm with just a class that is asynchronous listening for network connections. As soon as someone connected, a new form needs to be created. The Form gets created but hangs after creation. I'ts logical that that happens because the new Form doesn't get a Message Loop. The Message Loop is...
4
4786
by: Edwin Gomez | last post by:
I'm a C# developer and I'm new to Python. I would like to know if the concept of Asynchronous call-backs exists in Python. Basically what I mean is that I dispatch a thread and when the thread completes it invokes a method from the calling thread. Sort event driven concept with threads. Thanks. Ed Gomez
6
5103
by: HolyShea | last post by:
All, Not sure if this is possible or not - I've created a class which performs an asynchronous operation and provides notification when the operation is complete. I'd like the notification to be performed on the same thread thread that instantiated the class. One way to do this is to pass an ISynchronizeInvoke into the class and use it to...
0
7520
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7446
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7809
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6041
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5088
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3498
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1936
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.