When I intend to create an instance of the class ThreadServer, I got an error of execution. After debugging, it comes that the constructor code is executed with no error, but the line after the object creation is not executed and I get an error of execution: Windows says that the program encountered an error and has to close...
Here are some parts of my code if this can help understand:
The constructor code:
Code: Select all
ThreadServer::ThreadServer(wxSocketBase* socket): wxThread()
{
wxMessageBox("debug in the constructor!!");
this->sock = socket;
wxMessageBox("debug after socket");
// No problem there
}
The function which creates the thread:
Code: Select all
void newProgramFrame::OnClientConnect(wxSocketBase* sock)
{
wxMessageBox("Connexion arrived");
th = new ThreadServer(sock);
// Does not reach this line!!!!!!!!!!
wxMessageBox("Thread Instance Created");
th->Create();
wxMessageBox("Thread Created");
th->Run();
wxMessageBox("Thread launched");
return;
}
I am so upset with that (it worked very well yesterday!!), that I'm gonna take a small break and come back in some hours...I have to sleep a little.
If someone has an idea, don't hesitate to tell about it.