HANDLE CreateThread(
bla
bla
bla
""""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.
Thanx
bla
bla
bla
""""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.
Thanx
Allocate memory for a structure, fill it, and pass a pointer to the
structure to the threadproc.
structure to the threadproc.
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
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
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 :).
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 :).