Archived

This topic is now archived and is closed to further replies.

RyoxSinfar

creating threads with arguements

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
quote:
From MSDN
lpParameter
[in] Pointer to a variable to be passed to the thread.




Thanks Salsa!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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites