我觉得很奇怪,我在stdafx.h文件中加了这句代码:
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename ("EOF", "adoEOF")
接着我在CFormView的派生类中定义
// 定义ADO连接、命令、记录集变量指针
_ConnectionPtr m_pConnection;
_CommandPtr m_pCommand;
_RecordsetPtr m_pRecordset;
结果编译就出错。
syntax error : missing ';' before identifier 'm_pConnection'
e:\3\3\3view.h(42) : error C2501: '_ConnectionPtr' : missing storage-class or type specifiers
e:\3\3\3view.h(42) : error C2501: 'm_pConnection' : missing storage-class or type specifiers
e:\3\3\3view.h(43) : error C2146: syntax error : missing ';' before identifier 'm_pCommand'
e:\3\3\3view.h(43) : error C2501: '_CommandPtr' : missing storage-class or type specifiers
e:\3\3\3view.h(43) : error C2501: 'm_pCommand' : missing storage-class or type specifiers
e:\3\3\3view.h(44) : error C2146: syntax error : missing ';' before identifier 'm_pRecordset'
e:\3\3\3view.h(44) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
e:\3\3\3view.h(44) : error C2501: 'm_pRecordset' : missing storage-class or type specifiers
Error executing cl.exe.3.exe - 9 error(s), 0 warning(s)
这是什么原因呢?
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename ("EOF", "adoEOF")
接着我在CFormView的派生类中定义
// 定义ADO连接、命令、记录集变量指针
_ConnectionPtr m_pConnection;
_CommandPtr m_pCommand;
_RecordsetPtr m_pRecordset;
结果编译就出错。
syntax error : missing ';' before identifier 'm_pConnection'
e:\3\3\3view.h(42) : error C2501: '_ConnectionPtr' : missing storage-class or type specifiers
e:\3\3\3view.h(42) : error C2501: 'm_pConnection' : missing storage-class or type specifiers
e:\3\3\3view.h(43) : error C2146: syntax error : missing ';' before identifier 'm_pCommand'
e:\3\3\3view.h(43) : error C2501: '_CommandPtr' : missing storage-class or type specifiers
e:\3\3\3view.h(43) : error C2501: 'm_pCommand' : missing storage-class or type specifiers
e:\3\3\3view.h(44) : error C2146: syntax error : missing ';' before identifier 'm_pRecordset'
e:\3\3\3view.h(44) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
e:\3\3\3view.h(44) : error C2501: 'm_pRecordset' : missing storage-class or type specifiers
Error executing cl.exe.3.exe - 9 error(s), 0 warning(s)
这是什么原因呢?
..........
.........
...........
_ConnectionPtr m_pConnection;
_CommandPtr m_pCommand;
_RecordsetPtr m_pRecordset;
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename ("EOF", "adoEOF")
接着我在CFormView的派生类中定义
// 定义ADO连接、命令、记录集变量指针
_ConnectionPtr m_pConnection;
_CommandPtr m_pCommand;
_RecordsetPtr m_pRecordset;
现在编译没问题,可我要是在别的函数里添哪怕是一句代码,在编译就出错了,还是这个错误
我觉得很奇怪,我在stdafx.h文件中加了这句代码:
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename ("EOF", "adoEOF")
接着我在CFormView的派生类中定义
// 定义ADO连接、命令、记录集变量指针
_ConnectionPtr m_pConnection;
_CommandPtr m_pCommand;
_RecordsetPtr m_pRecordset;
结果编译就出错。
syntax error : missing ';' before identifier 'm_pConnection'
e:\3\3\3view.h(42) : error C2501: '_ConnectionPtr' : missing storage-class or type specifiers
...