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 *'
------解决方案--------------------
好像是类型不匹配的问题,CE 下需要 Unicode
------解决方案--------------------
有CE下的串口类,在网上找一下。
------解决方案--------------------
路过,自己再仔细看下吧
------解决方案--------------------
最好能贴出部分关键代码,便于大伙检查啊!
------解决方案--------------------
CE下的串口类在哪里?