| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
i have a problem in running threads in my project . hope somebody can help in guiding with the below. i have 2 classes. class A{ method A () { // calling method A in class B B->A(); } } class B{ method A() { ThreadHandle = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)B::B( ),NULL, CREATE_SUSPENDED, NULL); DWORD resume = ResumeThread( ThreadHandle ); //it has to return back to class A return S_OK; } method B() { sleep(5000); //do something } my problem is when threadhandle is created and resumethread is called it has to go in method B in class B and have to sleep for sometime , in the meanwhile in method A of class B . it has to return to class A . after it return it has to wake from sleep in method B and has to run what ever is ther in method B . can somebody help me how to do this . what my present situation is it is running the method B in class B and then returning to class A . i dont want like this . |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > C++ thread handling |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|