X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1a278e7befe2b9989526067dede645fb11ad779b..ee377e7f8b00ce842e8d754a1d22410d5440be30:/samples/exec/exec.cpp diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index 969f242b46..0a08de9af5 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -499,7 +499,7 @@ void MyFrame::OnClear(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Exec wxWidgets Sample\n© 2000-2002 Vadim Zeitlin"), + wxMessageBox(_T("Exec wxWidgets Sample\n(c) 2000-2002 Vadim Zeitlin"), _T("About Exec"), wxOK | wxICON_INFORMATION, this); } @@ -1053,9 +1053,9 @@ MyPipeFrame::MyPipeFrame(wxFrame *parent, : wxFrame(parent, wxID_ANY, cmd), m_process(process), // in a real program we'd check that the streams are !NULL here + m_out(*process->GetOutputStream()), m_in(*process->GetInputStream()), - m_err(*process->GetErrorStream()), - m_out(*process->GetOutputStream()) + m_err(*process->GetErrorStream()) { m_process->SetNextHandler(this); @@ -1114,9 +1114,11 @@ void MyPipeFrame::OnBtnSendFile(wxCommandEvent& WXUNUSED(event)) while ( len ) { const size_t CHUNK_SIZE = 4096; - size_t lenChunk = len > CHUNK_SIZE ? CHUNK_SIZE : len; + m_out.Write(pc, len > CHUNK_SIZE ? CHUNK_SIZE : len); - m_out.Write(pc, lenChunk); + // note that not all data could have been written as we don't block on + // the write end of the pipe + const size_t lenChunk = m_out.LastWrite(); pc += lenChunk; len -= lenChunk;