首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

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

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

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

[解决办法]
你建立一个mfc dll试试
[解决办法]
很早以前用过,感觉极不稳定,高速数据丢数。

[解决办法]
//你的程序报错的有点奇怪,
//凡是微软自定义的类型 BOOL,DWORD等等都出错。

//能不能说明开发工具,版本等信息?
[解决办法]
先include <windows.h>再试试。

热点排行