对话框程序中要用到新定义的类对象该把定义该对象的代码到什么地方
class CMyDlg : public CDialog
{
// Constructionpublic:
CNew m_new; //这个怎么放什么地方都出错,头文件也包含了
CMyDlg(CWnd* pParent = NULL); // standard constructor
void ToTray();
void DeleteTray();
// Dialog Data
//{{AFX_DATA(CMyDlg)
enum { IDD = IDD_MY_DIALOG };
// NOTE: the ClassWizard will add data members here //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMyDlg) protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementationprotected:
HICON m_hIcon; // Generated message map functions //{{AFX_MSG(CMyDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
。。
class CMyDlg : public CDialog
{
// Constructionpublic:
CNew m_new; //这个怎么放什么地方都出错,头文件也包含了
CMyDlg(CWnd* pParent = NULL); // standard constructor
void ToTray();
void DeleteTray();
// Dialog Data
//{{AFX_DATA(CMyDlg)
enum { IDD = IDD_MY_DIALOG };
// NOTE: the ClassWizard will add data members here //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMyDlg) protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementationprotected:
HICON m_hIcon; // Generated message map functions //{{AFX_MSG(CMyDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
。。
syntax error : missing ';' before identifier 'm_new'
error C2501: 'CNew' : missing storage-class or type specifiers
error C2501: 'm_new' : missing storage-class or type specifiers要是当作局部对象,在函数里用的时候定义或者作为全局对象定义到类的外面都不会报错