Wince平台下,使用CSerialPort类的问题

chenlunju 2012-03-10 12:23:06
Wince平台下,使用CSerialPort类,编译的时候有很多错误。 初学WinCE,不知如何解决
\SerialPort.cpp(155) : error C3861: 'BuildCommDCB': identifier not found
1>.\SerialPort.cpp(183) : error C2664: 'void ATL::CTraceFileAndLineInfo::operator ()(const wchar_t *,...) const' : cannot convert parameter 1 from 'const char [85]' to 'const wchar_t *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\SerialPort.cpp(366) : error C2664: 'void ATL::CTraceFileAndLineInfo::operator ()(const wchar_t *,...) const' : cannot convert parameter 1 from 'const char [16]' to 'const wchar_t *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\SerialPort.cpp(377) : error C2065: '_T' : undeclared identifier
1>.\SerialPort.cpp(377) : error C2143: syntax error : missing ')' before 'string'
1>.\SerialPort.cpp(377) : error C2059: syntax error : ')'
1>.\SerialPort.cpp(377) : error C2059: syntax error : ')'
1>.\SerialPort.cpp(403) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\SerialPort.cpp(470) : error C3861: 'GetOverlappedResult': identifier not found
1>.\SerialPort.cpp(575) : error C3861: 'GetOverlappedResult': identifier not found
1>.\SerialPort.cpp(630) : error C2664: 'strcpy' : cannot convert parameter 2 from 'LPCTSTR' to 'const char *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\SerialPort.cpp(631) : error C2664: 'strlen' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *'
...全文
305 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
dHdpdHRlcg0K 2013-09-17
  • 打赏
  • 举报
回复
Windows CE does not support overlapped I/O.
dHdpdHRlcg0K 2013-09-17
  • 打赏
  • 举报
回复
万能的楼主解决问题了没?
AraxLee 2013-07-20
  • 打赏
  • 举报
回复
自己写个吧,我就是自己写的,这样用的放心,若出问题也能很快找到根源。
yupengfan 2013-06-18
  • 打赏
  • 举报
回复
遇到同样的问题了,求教怎么解决的啊?
natuly163 2012-03-14
  • 打赏
  • 举报
回复
CE下的串口类在哪里?
zzf19870622 2012-03-12
  • 打赏
  • 举报
回复
最好能贴出部分关键代码,便于大伙检查啊!
ywc861962 2012-03-11
  • 打赏
  • 举报
回复
路过,自己再仔细看下吧
西山小月 2012-03-11
  • 打赏
  • 举报
回复
有CE下的串口类,在网上找一下。
91program 2012-03-10
  • 打赏
  • 举报
回复
好像是类型不匹配的问题,CE 下需要 Unicode

19,502

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧