multiply parameters to a thread

Started by
3 comments, last by Tera_Dragon 19 years, 7 months ago
How can I send multiple parameters to a thread? CreateThread ill only take 6 parameters, and therefore I can only send one to my thread.
____________________________________________________________Programmers Resource Central
Advertisement
iirc, you can simply pass a pointer as a parameter. The pointer can then be a class or struct or anything else big enough to handle everything you want to pass to the thread.
how about a pointer to a structure?
struct ThreadFuncParams{  int a;  char b;  float c;  ...}; ThreadFuncParams tfp;// initialization...handle = CreateThread( ..., ThreadFunc, (void *)&tfp);...int WINAPI ThreadFunc(void * args){  ThreadFuncParams tfp = (ThreadFuncParams *)args;  ...}
lol, yeah. I wasn't thinking. I also just realised that I typed multiply instead f multiple...
____________________________________________________________Programmers Resource Central

This topic is closed to new replies.

Advertisement