Help with thread............

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?TkFUSEFMWV9FQw==?=

    #1

    Help with thread............

    hello everybody, please i need your help,
    I try to work with thread in c++ , in easiest application work Ok but in
    application with thread the class doesn't ....the application show an
    critical error that said
    "has been a critical error and must be shoutdown ".
    the code is:
    DWORD WINAPI Controller::Exe cuteThread(PVOI D data)
    {
    Controller* pt = (Controller*)da ta;
    pt->objNavigator = Navigator(pt->currentInstitu tion, pt->currentMode,
    pt->visibility, pt->Timeout);
    pt->objNavigator.E xecute();
    Sleep(1000);
    return 0;
    }
    void Controller::Loa dNavigators(int Mode, int user)
    {
    HANDLE thread_handle; // this is the handle to the thread
    DWORD thread_id;
    for(int i=0; i<Controller::_ Institutions.si ze(); i++)
    {
    Controller::cur rentInstitution = Controller::_In stitutions[i];
    Controller::cur rentMode = Mode;
    thread_handle = CreateThread(NU LL, 0,&Controller:: ExecuteThread ,this, 0,
    &thread_id); // HERE ERROR
    Controller::put Results(Control ler::objNavigat or.GetResults() );
    Controller::_Se rvicesToExecute = _ServicesToExec ute +
    Controller::_In stitutions[i].getCountServic es();
    }
    }

    Please hellppppppppp me
    :O(

Working...