Events can not be received at times.
eg:(Use wxFormBuilder Inherit MainForm, in vs2010)
Code: Select all
// in the MainForm
.......
virtual void OnThreadSend( wxThreadEvent& event ) { event.Skip(); }
.......
//in Inherit
#include "thread.h"
class MainChildForm{
........
void OnThreadSend( wxThreadEvent& event ) ;
}
.......
MainChildForm::MainChildForm(){
///here bind the event OnThreadSend
.......
}
void MainChildForm::OnThreadSend( wxThreadEvent& event )
{
// here some times can't run.
OutputDebugString(wxT("I get the thread event"));
}
//in a thread
.......
#defind threadsend 2035
class thread: public wxthread
{
void* Entry(){
.......
OutputDebugString(wxT("I send the thread event"));
wxPostEvent((wxApp*)mApp, wxThreadEvent(wxEVT_THREAD, threadsend));
........
}
}
I can't find the cause......
----------------------------------------------------------------------------------------------------------------
second:
while I use the wxsocketclinet or wxsocketinputstream readall in thread. how to Interrupt it.
eg:
Code: Select all
wxSocketClient mSock;
mSocket.SetTimeOut(1000); //long time to wait
mSocket.read(lpbuff, len); //for wait, and the question : how can I Interrupt here.