2012年5月4日
摘要: char [] 对于socket 通信 和 串口通信 非常重要,1 cstring 转char[]DWORD dwBytesToWrite; CString strEdit(""); m_edtSend.GetWindowText(strEdit); if (strEdit.IsEmpty()) { return; } char SendBuf[500] = {0}; //strcpy(SendBuf,strEdit); TCHAR wcharbuff[500]; wcscpy(wcharbuff,LPCTSTR(strE... 阅读全文
posted @ 2012-05-04 11:43 markygis 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1 添加 #include <afxsock.h>2 在OnInitDialog()中添加if (!AfxSocketInit()){AfxMessageBox(_T("Windows 通信端口初始化失败"));return FALSE;} 阅读全文
posted @ 2012-05-04 11:35 markygis 阅读(254) 评论(0) 推荐(0) 编辑