各位高手本人没多少分
多担待
小弟做了两个FormView1和FormView2,让FormView2显示到FormView1上
代码如下
FormView1类名Stat
FormView2类名StatDataStat.h
CStatData* m_statData;//就定义了一个它
Stat.cppIMPLEMENT_DYNCREATE(CStat, CFormView)CStat::CStat()
: CFormView(CStat::IDD)
{
m_statData=new CStatData(this);
m_statData->Create(NULL, NULL, WS_CHILD | WS_VISIBLE,
CRect(50,50,50,50), this, AFX_IDW_PANE_FIRST, NULL); //{{AFX_DATA_INIT(CStat)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}CStat::~CStat()
{
}void CStat::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStat)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CStat, CFormView)
//{{AFX_MSG_MAP(CStat)
ON_BN_CLICKED(IDC_BTN_EDUCE, OnBtnEduce)
ON_BN_CLICKED(IDC_BTN_SELECT, OnBtnSelect)
ON_BN_CLICKED(IDC_BTN_MIMEOQR, OnBtnMimeoqr)
ON_BN_CLICKED(IDOK, OnOK)
ON_WM_DESTROY()
ON_WM_ERASEBKGND()
statData.h
class CStatData : public CFormView
{
public:
CStatData();
CStatData(CFormView*);// protected constructor used by dynamic creation
DECLARE_DYNCREATE(CStatData)// Form Data
public:
//{{AFX_DATA(CStatData)
enum { IDD = IDD_STATDATA_FORM };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA// Attributes
public:// Operations
public:
BOOL Create(LPCTSTR, LPCTSTR, DWORD,
const RECT&, CWnd*, UINT, CCreateContext*);StatData.cpp
IMPLEMENT_DYNCREATE(CStatData, CFormView)CStatData::CStatData()
: CFormView(CStatData::IDD)
{
//{{AFX_DATA_INIT(CStatData)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}BOOL CStatData::Create(LPCTSTR str1, LPCTSTR str2, DWORD word1,
const RECT& rect, CWnd* cwnd, UINT int1, CCreateContext* context)
{
return CFormView::Create(str1, str2, word1, rect, cwnd, int1, context);
}CStatData::CStatData(CFormView* pFormViewParent)
: CFormView(CStatData::IDD)
{
//{{AFX_DATA_INIT(t2)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CStatData::~CStatData()
{}可以编译出来就是不显示
不知道为什么
各位大侠帮帮咱
小弟先谢谢了
多担待
小弟做了两个FormView1和FormView2,让FormView2显示到FormView1上
代码如下
FormView1类名Stat
FormView2类名StatDataStat.h
CStatData* m_statData;//就定义了一个它
Stat.cppIMPLEMENT_DYNCREATE(CStat, CFormView)CStat::CStat()
: CFormView(CStat::IDD)
{
m_statData=new CStatData(this);
m_statData->Create(NULL, NULL, WS_CHILD | WS_VISIBLE,
CRect(50,50,50,50), this, AFX_IDW_PANE_FIRST, NULL); //{{AFX_DATA_INIT(CStat)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}CStat::~CStat()
{
}void CStat::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStat)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CStat, CFormView)
//{{AFX_MSG_MAP(CStat)
ON_BN_CLICKED(IDC_BTN_EDUCE, OnBtnEduce)
ON_BN_CLICKED(IDC_BTN_SELECT, OnBtnSelect)
ON_BN_CLICKED(IDC_BTN_MIMEOQR, OnBtnMimeoqr)
ON_BN_CLICKED(IDOK, OnOK)
ON_WM_DESTROY()
ON_WM_ERASEBKGND()
statData.h
class CStatData : public CFormView
{
public:
CStatData();
CStatData(CFormView*);// protected constructor used by dynamic creation
DECLARE_DYNCREATE(CStatData)// Form Data
public:
//{{AFX_DATA(CStatData)
enum { IDD = IDD_STATDATA_FORM };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA// Attributes
public:// Operations
public:
BOOL Create(LPCTSTR, LPCTSTR, DWORD,
const RECT&, CWnd*, UINT, CCreateContext*);StatData.cpp
IMPLEMENT_DYNCREATE(CStatData, CFormView)CStatData::CStatData()
: CFormView(CStatData::IDD)
{
//{{AFX_DATA_INIT(CStatData)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}BOOL CStatData::Create(LPCTSTR str1, LPCTSTR str2, DWORD word1,
const RECT& rect, CWnd* cwnd, UINT int1, CCreateContext* context)
{
return CFormView::Create(str1, str2, word1, rect, cwnd, int1, context);
}CStatData::CStatData(CFormView* pFormViewParent)
: CFormView(CStatData::IDD)
{
//{{AFX_DATA_INIT(t2)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CStatData::~CStatData()
{}可以编译出来就是不显示
不知道为什么
各位大侠帮帮咱
小弟先谢谢了
解决方案 »
- 在VS2008中运行opengl程序的问题,调式没问题,也无错误,就是没有结果,总是返回为零!
- CButton的简单问题
- DAO如何访问sql server 2005?
- SDI中如何知道有没有打开菜单?
- 请问不断在第一行插入数据的CListCtrl如何锁定选中的行????
- 关于字符转换?
- 请教关于数据插入的数据库的问题
- 一个刚学vc半个月的菜鸟的简单问题
- EnumDisplayDevices和EnumDisplaySettingEx为什么变成了undeclared identifier???
- CBITMAP与BITMAP有什么不同
- MFC窗口是一个线程吗?
- MCI_OPEN_PARMS的第一个参数dwCallback是什么意义?
类名Stat 可以从CFormView派生
类名StatData 从CStatic派生