[問題] RS 232 傳輸問題 C++

看板C_and_CPP (C/C++)作者 (PHILLU)時間16年前 (2009/09/22 16:14), 編輯推噓1(104)
留言5則, 3人參與, 最新討論串1/1
小弟我目前在利用RS232做傳輸 做到已經可以開COM1了 只是目前在傳輸資料部份有點問題 也因小弟的 C++ 在新手階段 所以煩請大大指導一下 謝謝 以下為 傳輸資料的部份 HANDLE hCom; DCB dcb; COMMTIMEOUTS cto; int fSuccess; DWORD cReadBytes ; DWORD cWriteBytes ; int szReadText[1],szWriteText[10]; int ClickEdit01St=0; int ClickEdit01=0; void Crs232test4Dlg::OnBnClickedButton2Send() { int szWriteText[10]; int fSuccess; HANDLE hCom; DWORD cWriteBytes ; CString str1; CEdit* Edit01 = (CEdit*)GetDlgItem(IDC_EDIT_writebox); Edit01->GetWindowTextW(str1); //strcpy (szWriteText, str1); fSuccess = WriteFile (hCom, szWriteText, , &cWriteBytes, 0); if(!fSuccess) AfxMessageBox(_T("WriteFile Fail !"),MB_OK); CloseHandle(hCom); } void Crs232test4Dlg::OnEnSetfocusEdit1() { if(ClickEdit01St==0) { CString str; str=""; SetDlgItemText(IDC_EDIT1,str); ClickEdit01St=1; } ClickEdit01=1; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 124.11.23.107

09/22 17:28, , 1F
..................................
09/22 17:28, 1F

09/23 11:07, , 2F
???????
09/23 11:07, 2F

09/24 09:44, , 3F
你好,雖然我也是程式新手這問題我也不會,不過你這個問
09/24 09:44, 3F

09/24 09:45, , 4F
法好像等於沒問,就好像今天天氣晴朗,你拿了一張天氣預
09/24 09:45, 4F

09/24 09:46, , 5F
報圖給路人看的感覺,別人猜不出你的問題點...
09/24 09:46, 5F
文章代碼(AID): #1Ak8TQi1 (C_and_CPP)
文章代碼(AID): #1Ak8TQi1 (C_and_CPP)