Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Clab4Dlg::OnBnClickedButton3(){ //SEND
- CString msg, pole;
- m_edit_input.GetWindowTextA(pole);
- msg.Format("PUT %s", pole);
- char rec[1024];
- unsigned long rozOdp = 0;
- int a = CallNamedPipe("\\\\.\\pipe\\sysopnp", msg.GetBuffer(), msg.GetLength(), rec, 1024, &rozOdp, NMPWAIT_USE_DEFAULT_WAIT);
- m_edit_output.SetWindowTextA(rec);
- }
- void Clab4Dlg::OnBnClickedButton2(){ // GET
- CString wynik;
- char answer[1024];
- unsigned long rozOdp = 0;
- int a = CallNamedPipe("\\\\.\\pipe\\sysopnp", "GET", 3, answer, 1024, &rozOdp, NMPWAIT_USE_DEFAULT_WAIT);
- for (int i = 0; i < rozOdp; i++) {
- if (answer[i] == '\n')
- wynik += _T("\r\n");
- else
- wynik += _T(answer[i]);
- }
- m_edit_output.SetWindowTextA(wynik);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement