creating threads with arguements
I jsut realized that in all the CreateThread functions I have seen there are no arguement paranthasesis... yeah
well anyway, I need to start a thread with arguements. Does anyone know how to do this?
There''s a DWORD argument which gets passed to your thread proc. set that to be a pointer to a structure with whatever data you need.
why not create a data structure with your data and simply read it from the thread when you create it?
quote:From MSDN
lpParameter
[in] Pointer to a variable to be passed to the thread.
Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
Okay so say I wanted to pass a value X which I get from the function it is called in, and used which tells me which thread handle to use. (I use a function to find the next open one)
and do I just do a regular pointer for the arguement? Or does it have to be a struct?
Are all arguements passed by reference always?
[edited by - RyoxSinfar on April 23, 2004 7:38:50 AM]
[edited by - RyoxSinfar on April 23, 2004 8:14:24 AM]
and do I just do a regular pointer for the arguement? Or does it have to be a struct?
Are all arguements passed by reference always?
[edited by - RyoxSinfar on April 23, 2004 7:38:50 AM]
[edited by - RyoxSinfar on April 23, 2004 8:14:24 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement