各位高手本人没多少分
多担待
小弟做了两个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()
{}可以编译出来就是不显示
不知道为什么
各位大侠帮帮咱
小弟先谢谢了