大家用过SerialPort类没有,我现在建了一个Dll的工程,加进去之后就一直抱错,还需要改蛇呢没地方吗?

fisher3014 2009-06-23 02:46:05
df417ddl.cpp
E:\project\printerddl\SerialPort.h(25) : error C2146: syntax error : missing ';' before identifier 'InitPort'
E:\project\printerddl\SerialPort.h(25) : error C2501: 'BOOL' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(25) : error C2061: syntax error : identifier 'CWnd'
E:\project\printerddl\SerialPort.h(26) : error C2146: syntax error : missing ';' before identifier 'm_hComm'
E:\project\printerddl\SerialPort.h(26) : error C2501: 'HANDLE' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(26) : error C2501: 'm_hComm' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(29) : error C2146: syntax error : missing ';' before identifier 'StartMonitoring'
E:\project\printerddl\SerialPort.h(29) : error C2501: 'BOOL' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(30) : error C2146: syntax error : missing ';' before identifier 'RestartMonitoring'
E:\project\printerddl\SerialPort.h(30) : error C2501: 'BOOL' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(31) : error C2146: syntax error : missing ';' before identifier 'StopMonitoring'
E:\project\printerddl\SerialPort.h(31) : error C2501: 'BOOL' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(33) : error C2146: syntax error : missing ';' before identifier 'GetWriteBufferSize'
E:\project\printerddl\SerialPort.h(33) : error C2501: 'DWORD' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(34) : error C2146: syntax error : missing ';' before identifier 'GetCommEvents'
E:\project\printerddl\SerialPort.h(34) : error C2501: 'DWORD' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(35) : error C2146: syntax error : missing ';' before identifier 'GetDCB'
E:\project\printerddl\SerialPort.h(35) : error C2501: 'DCB' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(39) : error C2061: syntax error : identifier 'LPCTSTR'
E:\project\printerddl\SerialPort.h(40) : error C2061: syntax error : identifier 'LPCTSTR'
E:\project\printerddl\SerialPort.h(40) : error C2535: 'void __thiscall CSerialPort::WriteToPort(void)' : member function already defined or declared
E:\project\printerddl\SerialPort.h(39) : see declaration of 'WriteToPort'
E:\project\printerddl\SerialPort.h(45) : error C2146: syntax error : missing ';' before identifier 'CommThread'
E:\project\printerddl\SerialPort.h(45) : error C2061: syntax error : identifier 'LPVOID'
E:\project\printerddl\SerialPort.h(46) : error C2061: syntax error : identifier 'COMSTAT'
E:\project\printerddl\SerialPort.h(50) : error C2143: syntax error : missing ';' before '*'
E:\project\printerddl\SerialPort.h(50) : error C2501: 'CWinThread' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(50) : error C2501: 'm_Thread' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(53) : error C2146: syntax error : missing ';' before identifier 'm_csCommunicationSync'
E:\project\printerddl\SerialPort.h(53) : error C2501: 'CRITICAL_SECTION' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(53) : error C2501: 'm_csCommunicationSync' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(54) : error C2146: syntax error : missing ';' before identifier 'm_bThreadAlive'
E:\project\printerddl\SerialPort.h(54) : error C2501: 'BOOL' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(54) : error C2501: 'm_bThreadAlive' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(57) : error C2146: syntax error : missing ';' before identifier 'm_hWriteEvent'
E:\project\printerddl\SerialPort.h(57) : error C2501: 'HANDLE' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(57) : error C2501: 'm_hWriteEvent' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(58) : error C2146: syntax error : missing ';' before identifier 'm_hShutdownEvent'
E:\project\printerddl\SerialPort.h(58) : error C2501: 'HANDLE' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(58) : error C2501: 'm_hShutdownEvent' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(64) : error C2146: syntax error : missing ';' before identifier 'm_hEventArray'
E:\project\printerddl\SerialPort.h(64) : error C2501: 'HANDLE' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(64) : error C2501: 'm_hEventArray' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(67) : error C2146: syntax error : missing ';' before identifier 'm_ov'
E:\project\printerddl\SerialPort.h(67) : error C2501: 'OVERLAPPED' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(67) : error C2501: 'm_ov' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(68) : error C2146: syntax error : missing ';' before identifier 'm_CommTimeouts'
E:\project\printerddl\SerialPort.h(68) : error C2501: 'COMMTIMEOUTS' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(68) : error C2501: 'm_CommTimeouts' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(69) : error C2146: syntax error : missing ';' before identifier 'm_dcb'
E:\project\printerddl\SerialPort.h(69) : error C2501: 'DCB' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(69) : error C2501: 'm_dcb' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(72) : error C2143: syntax error : missing ';' before '*'
E:\project\printerddl\SerialPort.h(72) : error C2501: 'CWnd' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(72) : error C2501: 'm_pOwner' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(75) : error C2146: syntax error : missing ';' before identifier 'm_nPortNr'
E:\project\printerddl\SerialPort.h(75) : error C2501: 'UINT' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(75) : error C2501: 'm_nPortNr' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(77) : error C2146: syntax error : missing ';' before identifier 'm_dwCommEvents'
E:\project\printerddl\SerialPort.h(77) : error C2501: 'DWORD' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(77) : error C2501: 'm_dwCommEvents' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(78) : error C2146: syntax error : missing ';' before identifier 'm_nWriteBufferSize'
E:\project\printerddl\SerialPort.h(78) : error C2501: 'DWORD' : missing storage-class or type specifiers
E:\project\printerddl\SerialPort.h(78) : error C2501: 'm_nWriteBufferSize' : missing storage-class or type specifiers
...全文
229 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
mimangzhe2011 2012-06-01
  • 打赏
  • 举报
回复
哈哈 问题解决了哦 呵呵呵哈哈哈哈
mimangzhe2011 2012-06-01
  • 打赏
  • 举报
回复
问题解决了没有?给我说说 怎么解决的 谢谢
q472599451 2012-03-07
  • 打赏
  • 举报
回复
和楼主遇到同样的问题,不知道楼主解决了没有?
会思考的草 2009-08-12
  • 打赏
  • 举报
回复
先include <windows.h>再试试。
一条晚起的虫 2009-07-03
  • 打赏
  • 举报
回复
//你的程序报错的有点奇怪,
//凡是微软自定义的类型 BOOL,DWORD等等都出错。

//能不能说明开发工具,版本等信息?
用户 昵称 2009-06-26
  • 打赏
  • 举报
回复
很早以前用过,感觉极不稳定,高速数据丢数。
lovezha1028 2009-06-24
  • 打赏
  • 举报
回复
你建立一个mfc dll试试

2,643

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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