关于MFC中的构造函数
我在MFC中创建了一个对话框资源,在头文件中,自动生成如下代码:其中的构造函数:CDialogMyMethod(){returnCDialog;}但不懂,那位大侠帮忙解答...
我在MFC中创建了一个对话框资源,在头文件中,自动生成如下代码:其中的构造函数:CDialog MyMethod()
{
return CDialog;
}
但不懂,那位大侠帮忙解答一下,不胜感激!
// CTestDlg dialog
class CTestDlg : public CDialog
{
// Construction
public:
CTestDlg(CWnd* pParent = NULL); // standard constructor
CDialog MyMethod()
{
return CDialog;
}
// Dialog Data
//{{AFX_DATA(CTestDlg)
enum { IDD = IDD_DIALOG1 };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTestDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTestDlg)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TESTDLG_H__63616F99_66A8_48F6_A6AC_0AF045120801__INCLUDED_) 展开
{
return CDialog;
}
但不懂,那位大侠帮忙解答一下,不胜感激!
// CTestDlg dialog
class CTestDlg : public CDialog
{
// Construction
public:
CTestDlg(CWnd* pParent = NULL); // standard constructor
CDialog MyMethod()
{
return CDialog;
}
// Dialog Data
//{{AFX_DATA(CTestDlg)
enum { IDD = IDD_DIALOG1 };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTestDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTestDlg)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TESTDLG_H__63616F99_66A8_48F6_A6AC_0AF045120801__INCLUDED_) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询