HANDLE CreateThread(


""""LPVOID lpParameter, // argument for new thread """"

The api call to CreateThread gives you the ability to send an optional argument.

Is there a way to send more then one parameter.

Posted on 2001-09-25 19:58:54 by titan
Allocate memory for a structure, fill it, and pass a pointer to the
structure to the threadproc.
Posted on 2001-09-25 21:15:59 by f0dder
thanx fodder

i made a structure in my program that is never called and it compiles ok

didn't know i had to aloocate memory for it
Posted on 2001-09-25 22:17:04 by titan
Well, allocating memory depends on how your stuff works :). If you're
only running one thread with the threadproc, you can probably get
away with using some global data. However, the same threadproc
can be started as a thread multiple times (this is pretty useful eg
for a multithreaded multi-connection resuming filedownloader (nice
name, eh?;))), and in such a case, I can imagine a single global piece
of data wouldn't work, and you'd have to do the alloc.

But as always, it all depends on the situation :).
Posted on 2001-09-26 08:28:41 by f0dder