我在两个类的前面加入class CHeadDlg,class CDialog1;
在stdafx.h里面加入#include "Dialog1.h"
#include "headDlg.h"编译时候怎么错误了。
我的本意是想可以相互调用对方的函数。class CHeadDlg;
class CDialog1 : public CDialog
{
// Construction
private:
// CHeadDlg *m_headdlg;
class CDialog1;
class CHeadDlg : public CDialog
{#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT#include "Dialog1.h"
#include "headDlg.h"//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !d
在stdafx.h里面加入#include "Dialog1.h"
#include "headDlg.h"编译时候怎么错误了。
我的本意是想可以相互调用对方的函数。class CHeadDlg;
class CDialog1 : public CDialog
{
// Construction
private:
// CHeadDlg *m_headdlg;
class CDialog1;
class CHeadDlg : public CDialog
{#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT#include "Dialog1.h"
#include "headDlg.h"//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !d
class CHeadDlg;
class CDialog1 : public CDialog
{
// Construction
private:
// CHeadDlg *m_headdlg;
}
在CDialog1类的cpp中用 CHeadDlg 的方法时,在cpp中 include "HeadDlg.h"#include "Dialog1.h"
class CHeadDlg : public CDialog
{
//使用CDialog1 类;
}