When I looked at the #6 of the call stack, I see this:
if(!buffErr.IsEmpty() && m_notifiedWindow) {
// we got some data, send event to parent
//clProcessEvent e(wxEVT_ASYNC_PROCESS_STDERR);
wxThreadEvent e(wxEVT_ASYNC_PROCESS_STDERR, wxID_NONE);
//wxString& b = const_cast<wxString&>(e.GetOutput());
//b.swap(buffErr);
//e.SetProcess(m_process);
//m_notifiedWindow->AddPendingEvent(e);
//-std::string stdstr = buffErr.ToStdString(); loses data
#if wxCHECK_VERSION(3,1,5)
std::string stdstr = buff.utf8_string();
#else
std::string stdstr = buff.ToStdString(wxConvUTF8);
#endif
e.SetPayload<std::string*>(&stdstr);
m_notifiedWindow->ProcessEvent(e);
}
It shows this statement: m_notifiedWindow->ProcessEvent(e);
So, this is a working thread, is it possible to call the ProcessEvent event from the working thread? I think it should be "PostEvent" or "QueueEvent". Am I correct?