LeftView.h #if !defined(AFX_LEFTVIEW_H__29FDEE6F_5FDE_41BB_BFAC_28793AE50F11__INCLUDED_)
#define AFX_LEFTVIEW_H__29FDEE6F_5FDE_41BB_BFAC_28793AE50F11__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// LeftView.h : header file
///////////////////////////////////////////////////////////////////////////////
// CLeftView viewclass CLeftView : public CHtmlView
{
protected:
CLeftView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CLeftView)// Attributes
public:// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLeftView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnInitialUpdate(); // called first time after construct
virtual void OnNavigateComplete2(LPCTSTR lpszURL);
//}}AFX_VIRTUAL// Implementation
protected:
virtual ~CLeftView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif // Generated message map functions
protected:
//{{AFX_MSG(CLeftView)
// NOTE - the ClassWizard will add and remove 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_LEFTVIEW_H__29FDEE6F_5FDE_41BB_BFAC_28793AE50F11__INCLUDED_)
RightFrom.h#pragma once// RightFrom 窗体视图class RightFrom : public CFormView
{
DECLARE_DYNCREATE(RightFrom)protected:
RightFrom(); // 动态创建所使用的受保护的构造函数
virtual ~RightFrom();public:
enum { IDD = IDD_DIALOG1 };
#ifdef _DEBUG
virtual void AssertValid() const;
#ifndef _WIN32_WCE
virtual void Dump(CDumpContext& dc) const;
#endif
#endifprotected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MESSAGE_MAP()
};MainFrm.cpp
m_splitter.CreateStatic(this, 1, 2);
m_splitter.CreateView(0,0, RUNTIME_CLASS(CLeftView), CSize(750, 0), pContext);//tag1
//m_splitter.CreateView(0,1,RUNTIME_CLASS(RightFrom),CSize(200,0),NULL);
m_splitter.CreateView(0,1, RUNTIME_CLASS(RightFrom), CSize(100, 0), pContext);// tag2
return CMDIFrameWnd::OnCreateClient(lpcs, pContext);我注释掉 tag2时运行正常,
添加tag2后弹出 Debug Assertion Failed!错误
#define AFX_LEFTVIEW_H__29FDEE6F_5FDE_41BB_BFAC_28793AE50F11__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// LeftView.h : header file
///////////////////////////////////////////////////////////////////////////////
// CLeftView viewclass CLeftView : public CHtmlView
{
protected:
CLeftView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CLeftView)// Attributes
public:// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLeftView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnInitialUpdate(); // called first time after construct
virtual void OnNavigateComplete2(LPCTSTR lpszURL);
//}}AFX_VIRTUAL// Implementation
protected:
virtual ~CLeftView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif // Generated message map functions
protected:
//{{AFX_MSG(CLeftView)
// NOTE - the ClassWizard will add and remove 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_LEFTVIEW_H__29FDEE6F_5FDE_41BB_BFAC_28793AE50F11__INCLUDED_)
RightFrom.h#pragma once// RightFrom 窗体视图class RightFrom : public CFormView
{
DECLARE_DYNCREATE(RightFrom)protected:
RightFrom(); // 动态创建所使用的受保护的构造函数
virtual ~RightFrom();public:
enum { IDD = IDD_DIALOG1 };
#ifdef _DEBUG
virtual void AssertValid() const;
#ifndef _WIN32_WCE
virtual void Dump(CDumpContext& dc) const;
#endif
#endifprotected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MESSAGE_MAP()
};MainFrm.cpp
m_splitter.CreateStatic(this, 1, 2);
m_splitter.CreateView(0,0, RUNTIME_CLASS(CLeftView), CSize(750, 0), pContext);//tag1
//m_splitter.CreateView(0,1,RUNTIME_CLASS(RightFrom),CSize(200,0),NULL);
m_splitter.CreateView(0,1, RUNTIME_CLASS(RightFrom), CSize(100, 0), pContext);// tag2
return CMDIFrameWnd::OnCreateClient(lpcs, pContext);我注释掉 tag2时运行正常,
添加tag2后弹出 Debug Assertion Failed!错误
解决方案 »
- onpaint中贴了一幅图,鼠标放上去的时候,如何在鼠标旁边显示这幅图的名字
- 如何避免读取一个空读卡器时弹出文件异常对话框
- 滚动局部区域?
- 请教高手,打印自绘曲线问题!!
- 显示器亮度。。。
- 继续发贴:请问使用Socket通过ISA防火墙访问外网HTTP页面的具体流程、验证方法(ISA防火墙是需要验证的)
- 为什么在播放声音的时候程序响应会变慢
- 简单问题
- 将符合条件的数据存入一维数组中,出现问题!
- ======>>>>谁有<<Inside ATL>>这本书<<<<<======
- 按钮按一次,正常显示对话框,第二次就报错
- VS2008 Add Class报错:File xxxx.h is not in project
m_wndSplitter->Create(this,RUNTIME_CLASS(CLeftView),NULL,pContext,true);
m_wndSplitter->Create(this,RUNTIME_CLASS(RightFrom),NULL,pContext,true);
m_wndSplitter->SetInitialStatus();
RECT r;
int cur, min; ::GetWindowRect( ::GetDesktopWindow(), &r ); // create splitter window
if( !m_wndSplitter_h.CreateStatic( this, 2, 1 ) )
{
return FALSE;
} if(
!m_wndSplitter_h.CreateView( 1, 0, RUNTIME_CLASS( CNULLView ), CSize( 0, 0 ), pContext )
//!m_wndSplitter_h.CreateView( 1, 0, RUNTIME_CLASS( CSnooperView ), CSize( 0, 0 ), pContext )
)
{
m_wndSplitter_h.DestroyWindow();
return FALSE;
} if( !m_wndSplitter_v.CreateStatic( &m_wndSplitter_h, 1, 2,
WS_CHILD | WS_VISIBLE,
m_wndSplitter_h.IdFromRowCol( 0, 0 ) )
)
{
return FALSE;
} if(
!m_wndSplitter_v.CreateView( 0, 0, RUNTIME_CLASS( CSnooperView ), CSize( 0, r.bottom ), pContext ) ||
//!m_wndSplitter_v.CreateView( 0, 0, RUNTIME_CLASS( CNULLView ), CSize( 0, r.bottom ), pContext ) ||
!m_wndSplitter_v.CreateView( 0, 1, RUNTIME_CLASS( CNULLView ), CSize( 0, 0 ), pContext )
)
{
m_wndSplitter_h.DestroyWindow();
m_wndSplitter_v.DestroyWindow();
return FALSE;
}也看不出来有什么问题,懒得调,贴俺的代码贴上去当参考吧。
m_splitter.CreateView(0,0, RUNTIME_CLASS(CLeftView), CSize(750, 0), pContext);//tag1
//m_splitter.CreateView(0,1,RUNTIME_CLASS(RightFrom),CSize(200,0),NULL);
m_splitter.CreateView(0,1, RUNTIME_CLASS(RightFrom), CSize(100, 0), pContext);// tag2
return CMDIFrameWnd::OnCreateClient(lpcs, pContext);你的RightFrom关联的对话框模板是Child风格吗?另外最后return TRUE;