I have changed the question with a simpler example to understand the problem:
Suppose we have class rectangle
class CRectangle
{
int x, y;
public:
void set_values (int a,int b)
{
x = a;
y = b;
}
Here you see that we creating an object in main fn and depending on our need calling the various fns of the class.
Now I want to make this class threadable in the sense I want to the class fns to be executed in a thread.
So I wrote the following class:
class Thread
{
Thread *threadptr;
HANDLE ThreadHandle;
If you have no problem coding a main() function, then you should have no problem with a "thread main". Any function called from execute(), or from a function called from execute, etc. will be called on the thread.