error in CreateThread

Hi all ,
i am trying following code in vc++ 2008 , i am getting compiler errors which
i am not able to understand , can some one help me , thanks in advance

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class myClass
{
public:

void my_thread_func()
{

}

void my_create_thread()
{
  CreateThread(NULL,NULL,LPTHREAD_START_ROUTINE(my_thread_func),NULL,NULL,NULL); //error here
}
}
};


i am getting problem when providing function to CreateThread (a class function)
it works when i provide a global function (non member).
That is because a non-static class member function is not a suitable as a callback target from a C style api function.


((PS. The thread function should also return DWORD not void and also should take a LPVOID as parameter))
Last edited on
vivmen, I had a similar problem, take a look at my post and see if the way I did it helps.
http://www.cplusplus.com/forum/general/26355/
Thanks to both of you .
hello friends, i am new to this forum. i hope i will learn more from this forum.





thank you







-----------------------------------
For connecting to remote desktop of another computer (via internet or network) and controls. Also connecting to VNCServer through Repeater or directly to VNCServer and a lot of other configuration options. For more details [url=http://www.abtollc.com/VNCViewer.aspx /]VNCServer [/url]
Topic archived. No new replies allowed.