类1:
class DataControl_ZTManager : public CDialog
{
// Construction
public:
DataControl_ZTManager(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(DataControl_ZTManager)
enum { IDD = IDD_DataControl_ZTManager };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DataControl_ZTManager)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(DataControl_ZTManager)
// 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_DATACONTROL_ZTMANAGER_H__197A86A0_F9F5_4DFB_9001_62AEEF2603EC__INCLUDED_)
类2:
class DataControl_SJKHF : public CDialog
{
// Construction
public:
DataControl_SJKHF(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(DataControl_SJKHF)
enum { IDD = IDD_DC_SJKXF };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DataControl_SJKHF)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(DataControl_SJKHF)
// 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_DATACONTROL_SJKHF_H__41FF927C_A390_490A_9CAF_B9003ECFCA05__INCLUDED_)
实例化类的指针:
DataControl_SJKHF *pDc_SJKHF_;
DataControl_ZTManager *pDc_ZTManager;
创建窗口:
pDc_ZTManager=new DataControl_ZTManager();
pDc_ZTManager->Create(IDD_DataControl_ZTManager);
//该窗口创建的时候失败,句柄返回一直为00000,不知为啥?
pDc_SJHF=new DataControl_SJHF();
pDc_SJHF->Create(IDD_DC_SJHF,this);