一个静态成员怎么定义?
我想在VC中定义一个静态成员变量。但是在定义数据成员区定义,总是出现错误。
希望大家帮忙。下面是一段类的声明,请各位朋友指出在那里可以定义静态成员变量。谢谢!!
// PasswordDialogDlg.h : header file
//
#include "PasswordSetup.h"
#if !defined(AFX_PASSWORDDIALOGDLG_H__46F75226_F5A9_11D6_B36E_001060734737__INCLUDED_)
#define AFX_PASSWORDDIALOGDLG_H__46F75226_F5A9_11D6_B36E_001060734737__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CPasswordDialogDlg dialog
class CPasswordDialogDlg : public CDialog
{
// Construction
public:
CPasswordDialogDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CPasswordDialogDlg)
enum { IDD = IDD_PASSWORDDIALOG_DIALOG };
static int _password;---------->我在此处定义,编译时出现连接错误错误
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPasswordDialogDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CPasswordDialogDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnButtonPasswordSetup();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PASSWORDDIALOGDLG_H__46F75226_F5A9_11D6_B36E_001060734737__INCLUDED_)