how to create thread with callback

D

Daniel

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
 
D

Daniel

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
 
C

Carlos

this could help you, process.waitforexit();
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.
 
C

Carlos

Perhaps this code could help u

ProcessStartInfo ^prData;
prData = new ProcessStartInfo();
prData->Verb = "open";
prData->FileName = "c:\\file.txt";
Process ^pr = Process::Start(prInfo);

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

Carlos.
 
C

Carlos

wrong copy-paste on last post

ProcessStartInfo ^prData;
prData = gcnew ProcessStartInfo();
prData->Verb = "open";
prData->FileName = "c:\\file.txt";
Process ^pr = Process::Start(prData);
 
B

Ben Voigt [C++ MVP]

Daniel said:
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 BackgroundWorker class.
 

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

Top