- how to initialize and terminate multithread in dllmain
- Posted by Kai on September 7th, 2003
Hi, all
I am trying write a dll which will have two thread A and B.
I want to initalize A and B when DLL_PROCESS_ATTACH, to terminate A and B
when DLL_PROCESS_DETACH.
When initalizing, A create thread B, and wait B finish.
When terminating, A notify B, and wait B finish too.
Thanks,
Kai
- Posted by Nick Ryan on September 7th, 2003
You can create a thread in DllMain, but you cannot wait for it to begin
executing (among other DllMain restrictions). Follow the suggestions in
the MSDN page on DllMain and put all complex init/uninit into separate
functions invoked at other times.
Kai wrote:
--
Nick Ryan (MVP for DDK)
- Posted by Kai on September 9th, 2003
Thank you.
For initalizing in ATTACH, I can put it into separate functions invoked at
other times.
But for cleanup in DETACH, how can I know when it will be detached by
application?
Is there any way to write my own entry function like dllmain for detach?
Cheers,
Kai
"Nick Ryan" <nryan@nryan.com> wrote in message
news:vlmsa422i8u089@corp.supernews.com...