新手学习中问题,请大虾指教
在代码中:
class CSingleView : public CView
{
protected: // create from serialization only
CSingleView();
DECLARE_DYNCREATE(CSingleView)
// Attributes
public:
CSingleDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSingleView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
string str; virtual ~CSingleView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CSingleView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
红字部分是自己添加的一个变量声明,其余代码是mfc框架生成的。
加上代码就报错:
error C2146: syntax error : missing ';' before identifier 'str'
error C2501: 'string' : missing storage-class or type specifiers
error C2501: 'str' : missing storage-class or type specifiers
本人刚在学习中,请赐教
class CSingleView : public CView
{
protected: // create from serialization only
CSingleView();
DECLARE_DYNCREATE(CSingleView)
// Attributes
public:
CSingleDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSingleView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
string str; virtual ~CSingleView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CSingleView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
红字部分是自己添加的一个变量声明,其余代码是mfc框架生成的。
加上代码就报错:
error C2146: syntax error : missing ';' before identifier 'str'
error C2501: 'string' : missing storage-class or type specifiers
error C2501: 'str' : missing storage-class or type specifiers
本人刚在学习中,请赐教
...全文
相关推荐
大虾们都来帮我整整Matlab的Sfunction问题急-theta.m
大虾们都来帮我整整Matlab的Sfunction问题急-theta.m在下是新手,遇到问题如下,请高手帮帮我
大虾浏览器 广东学习网络助手-大虾浏览器 v2.4
广东学习网络助手-大虾浏览器,本程序是帮助需要学习广东省专业技术人员继续教育的学员更方便快捷完成任务。功能:是广东学习网网站专用浏览器,有一键登录、自动学习等功能。
求助各位大虾关于itae积分指标实现的问题-heatexdemo.m
求助各位大虾关于itae积分指标实现的问题-heatexdemo.m这个在matlab里面怎么实现阿 ! 比如用pid去控制一个最简单的一阶惯性环节!用这个itae指标去优化pid的参数这个怎么弄 具
C语言多机通讯(程序写的不是很好欢迎指教)
希望各位大虾指教指教!
我有一个软件只有30次的使用限制,不知怎样才能解除这个限制。软件已上传,测试无毒,请哪位大虾帮忙解决一下,谢谢!
软件已上传,测试无毒,请哪位大虾帮忙解决一下,谢谢!


