我做的是一个单文档应用程序!
在VIEW 类里面有个这个函数,是自动生成的代码!
CTickets_SellDoc* GetDocument();
这个定义在类的头文件里面,也就是CVIEW里面,
开始没问题,后来我在VIEW 里面添加了一个成员CArray<CServerSock*,CServerSock*>;之后,而且还包含了头文件,但是他报错说:error C2065: 'CServerSock' : undeclared identifier这个我明明已经将其头文件包含进来了,不知道为什么????然后就报错了很多!
error C2059: syntax error : '>'
我添加的代码如下:
#include "Tickets_SellDoc.h"
#include "ServerSock.h"
#include <afxtempl.h>
class CTickets_SellView : public CFormView
{
protected: // create from serialization only
CTickets_SellView();
DECLARE_DYNCREATE(CTickets_SellView)
public:
//{{AFX_DATA(CTickets_SellView)
enum { IDD = IDD_TICKETS_SELL_FORM };
CListCtrl m_nList;
CString m_nNum;
CString m_nDesStop;
CString m_nSrcStop;
int m_nTNum;//票数
int m_nPrice;
//}}AFX_DATA// Attributes
public:
CTickets_SellDoc* GetDocument();
void OnBtnSetup();
CArray<CServerSock,CServerSock*>;
// CServerSock Sock;
在VIEW 类里面有个这个函数,是自动生成的代码!
CTickets_SellDoc* GetDocument();
这个定义在类的头文件里面,也就是CVIEW里面,
开始没问题,后来我在VIEW 里面添加了一个成员CArray<CServerSock*,CServerSock*>;之后,而且还包含了头文件,但是他报错说:error C2065: 'CServerSock' : undeclared identifier这个我明明已经将其头文件包含进来了,不知道为什么????然后就报错了很多!
error C2059: syntax error : '>'
我添加的代码如下:
#include "Tickets_SellDoc.h"
#include "ServerSock.h"
#include <afxtempl.h>
class CTickets_SellView : public CFormView
{
protected: // create from serialization only
CTickets_SellView();
DECLARE_DYNCREATE(CTickets_SellView)
public:
//{{AFX_DATA(CTickets_SellView)
enum { IDD = IDD_TICKETS_SELL_FORM };
CListCtrl m_nList;
CString m_nNum;
CString m_nDesStop;
CString m_nSrcStop;
int m_nTNum;//票数
int m_nPrice;
//}}AFX_DATA// Attributes
public:
CTickets_SellDoc* GetDocument();
void OnBtnSetup();
CArray<CServerSock,CServerSock*>;
// CServerSock Sock;
解决方案 »
- error C2182: “Buffer”: 非法使用“void”类型
- 请问一个java调用vc编写的动态库的问题,除JNI外是不是还有其它的办法?
- 递归开线程疑问
- ADO的一个问题,如何知道select*from table会有多少字段?
- 请大家帮我看看我的一个动态变化的图形程序(俄罗斯方快的下落过程)
- 如何在程序中载入.chm?
- 游戏把我电脑加入了黑名单,进入不了。修改硬件也进不去,各位大牛来讨论一下
- loadLibrary的问题
- 把符号转化为字符串的宏技巧
- james_razor(蹬三轮的),有一个问题要跟你商榷 。其他同志勿进来
- vc 里面有没有类似 On Error GoTo的处理功能阿
- 什么命令使按钮控件不可见,再让它可见的命令呢
====>
CArray <CServerSock,CServerSock*> m_Array;
不好意思我写错了。就是报错!
d:\program\tickets_sell\tickets_sellview.h(21) : error C2059: syntax error : ','
d:\program\tickets_sell\tickets_sellview.h(21) : error C2059: syntax error : '>'
d:\program\tickets_sell\tickets_sellview.h(25) : error C2143: syntax error : missing ';' before '{'
d:\program\tickets_sell\tickets_sellview.h(52) : error C2065: 'pInfo' : undeclared identifier
d:\program\tickets_sell\tickets_sellview.h(52) : error C2275: 'CPrintInfo' : illegal use of this type as an expression
d:\microsoft visual studio\vc98\mfc\include\afxext.h(1026) : see declaration of 'CPrintInfo'
d:\program\tickets_sell\tickets_sellview.h(52) : error C2143: syntax error : missing ',' before ')'
d:\program\tickets_sell\tickets_sellview.h(53) : error C2275: 'CPrintInfo' : illegal use of this type as an expression
d:\microsoft visual studio\vc98\mfc\include\afxext.h(1026) : see declaration of 'CPrintInfo'
d:\program\tickets_sell\tickets_sellview.h(53) : error C2143: syntax error : missing ',' before ')'
d:\program\tickets_sell\tickets_sellview.h(54) : error C2275: 'CPrintInfo' : illegal use of this type as an expression
d:\microsoft visual studio\vc98\mfc\include\afxext.h(1026) : see declaration of 'CPrintInfo'
d:\program\tickets_sell\tickets_sellview.h(54) : error C2143: syntax error : missing ',' before ')'
d:\program\tickets_sell\tickets_sellview.h(77) : error C2065: 'pResult' : undeclared identifier
d:\program\tickets_sell\tickets_sellview.h(77) : error C2275: 'LRESULT' : illegal use of this type as an expression
d:\microsoft visual studio\vc98\include\windef.h(172) : see declaration of 'LRESULT'
d:\program\tickets_sell\tickets_sellview.h(77) : error C2143: syntax error : missing ',' before ')'
d:\program\tickets_sell\tickets_sellview.h(83) : error C2143: syntax error : missing ';' before '}'
d:\program\tickets_sell\serversock.h(16) : error C2143: syntax error : missing ';' before '{'
d:\program\tickets_sell\serversock.h(25) : error C2143: syntax error : missing ';' before '}'
d:\program\tickets_sell\serversock.h(28) : error C2143: syntax error : missing ';' before '{'
d:\program\tickets_sell\serversock.h(59) : error C2143: syntax error : missing ';' before '}'
d:\program\tickets_sell\mainfrm.h(13) : error C2143: syntax error : missing ';' before '{'
d:\program\tickets_sell\mainfrm.h(51) : error C2143: syntax error : missing ';' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(19) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(19) : error C2248: '_messageEntries' : cannot access private member declared in class 'CTickets_SellApp'
d:\program\tickets_sell\tickets_sell.h(40) : see declaration of '_messageEntries'
D:\program\Tickets_Sell\Tickets_Sell.cpp(19) : error C2143: syntax error : missing ',' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(21) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(21) : error C2065: 'OnAppAbout' : undeclared identifier
D:\program\Tickets_Sell\Tickets_Sell.cpp(21) : error C2440: 'type cast' : cannot convert from 'int *' to 'void (__thiscall CCmdTarget::*)(void)'
There is no context in which this conversion is possible
D:\program\Tickets_Sell\Tickets_Sell.cpp(21) : error C2143: syntax error : missing ',' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(26) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(26) : error C2248: 'OnFileNew' : cannot access protected member declared in class 'CWinApp'
d:\microsoft visual studio\vc98\mfc\include\afxwin.h(4166) : see declaration of 'OnFileNew'
D:\program\Tickets_Sell\Tickets_Sell.cpp(26) : error C2143: syntax error : missing ',' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(27) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(27) : error C2248: 'OnFileOpen' : cannot access protected member declared in class 'CWinApp'
d:\microsoft visual studio\vc98\mfc\include\afxwin.h(4167) : see declaration of 'OnFileOpen'
D:\program\Tickets_Sell\Tickets_Sell.cpp(27) : error C2143: syntax error : missing ',' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(29) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(29) : error C2248: 'OnFilePrintSetup' : cannot access protected member declared in class 'CWinApp'
d:\microsoft visual studio\vc98\mfc\include\afxwin.h(4170) : see declaration of 'OnFilePrintSetup'
D:\program\Tickets_Sell\Tickets_Sell.cpp(29) : error C2143: syntax error : missing ',' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(30) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(30) : error C2143: syntax error : missing ',' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(36) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(39) : error C2143: syntax error : missing ';' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(51) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(79) : error C2653: 'CMainFrame' : is not a class or namespace name
D:\program\Tickets_Sell\Tickets_Sell.cpp(79) : error C2065: 'classCMainFrame' : undeclared identifier
D:\program\Tickets_Sell\Tickets_Sell.cpp(80) : error C2027: use of undefined type 'CTickets_SellView'
d:\program\tickets_sell\tickets_sellview.h(16) : see declaration of 'CTickets_SellView'
D:\program\Tickets_Sell\Tickets_Sell.cpp(80) : error C2143: syntax error : missing ',' before ')'
D:\program\Tickets_Sell\Tickets_Sell.cpp(112) : error C2143: syntax error : missing ';' before '}'
_Sell.cpp(163) : error C2143: syntax error : missing ';' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(165) : error C2653: 'CAboutDlg' : is
D:\program\Tickets_Sell\Tickets_Sell.cpp(171) : error C2653: 'CAboutDlg' : is not a class or namespace name
D:\program\Tickets_Sell\Tickets_Sell.cpp(172) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(176) : error C2143: syntax error : missing ';' before '}'
C2248: '_messageEntries' : cannot access private member declared in class 'CFormView'
d:\microsoft visual studio\vc98\mfc\include\afxext.h(774) : see declaration of '_messageEntries'
D:\program\Tickets_Sell\Tickets_Sell.cpp(178) : error C2143: syntax error : missing ',' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(178) : error C2653: 'CAboutDlg' : is not a class or namespace name
D:\program\Tickets_Sell\Tickets_Sell.cpp(182) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(182) : error C2143: syntax error : missing ',' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(186) : error C2143: syntax error : missing ';' before '{'
D:\program\Tickets_Sell\Tickets_Sell.cpp(189) : error C2143: syntax error : missing ';' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(194) : error C2143: syntax error : missing ';' before '}'
D:\program\Tickets_Sell\Tickets_Sell.cpp(194) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'Y?, line 1)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Generating Code...
Compiling...
Tickets_SellView.cpp
Generating Code...
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\MainFrm.sbr': No such file or directory
class CServerSock;CArray<CServerSock*,CServerSock*> DataSock;
然后在XXXView.cpp里面包含它:
#include "Serversock.h"
#include "XXXView.h"
class CServerSock;
即可。