Advertisement
ElfikCo

C++ SO Ćwiczenia

Nov 19th, 2019
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. void Clab4Dlg::OnBnClickedButton3(){ //SEND
  2. CString msg, pole;
  3. m_edit_input.GetWindowTextA(pole);
  4. msg.Format("PUT %s", pole);
  5. char rec[1024];
  6. unsigned long rozOdp = 0;
  7. int a = CallNamedPipe("\\\\.\\pipe\\sysopnp", msg.GetBuffer(), msg.GetLength(), rec, 1024, &rozOdp, NMPWAIT_USE_DEFAULT_WAIT);
  8. m_edit_output.SetWindowTextA(rec);
  9. }
  10.  
  11.  
  12. void Clab4Dlg::OnBnClickedButton2(){ // GET
  13. CString wynik;
  14. char answer[1024];
  15. unsigned long rozOdp = 0;
  16. int a = CallNamedPipe("\\\\.\\pipe\\sysopnp", "GET", 3, answer, 1024, &rozOdp, NMPWAIT_USE_DEFAULT_WAIT);
  17.  
  18. for (int i = 0; i < rozOdp; i++) {
  19. if (answer[i] == '\n')
  20. wynik += _T("\r\n");
  21. else
  22. wynik += _T(answer[i]);
  23. }
  24. m_edit_output.SetWindowTextA(wynik);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement