Just a curious question. Is it wise to try and pass objects on the heap around using an integer array by storing in each array item the address of the objects.
Something like the following perhaps.
I see a compiler warning in the form of:Code:struct s1{ int a; int b; }; class c1{ c1(); ~c1(); float c; double d; } s1 *struct1 = new s1; c1 *class1 = new c1; int *params = new int[2]; params[1] = (int)struct1; params[2] = (int)class1; CreateThread(...,..., (void*)params); ThreadFunc(void* lpParams) { int *params = (int*)lpParams; s1 *struct1 = (s1*)params[0]; c1 *class1 = (c1*)params[1]; delete [] params; }
warning C4312: 'type cast' : conversion from 'int' to 's1 *' of greater size
Thoughts?