我创建了三个类, 
一个是class CAdv : public CHtmlView 
一个是class Info : public CScrollView 
一个是class CMytool : public CListView BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
{
// TODO: Add your specialized code here and/or call the base class
//分割2X1窗口,左边二行,右边一列
    CRect rect;
GetClientRect(&rect);
    if(m_wndSplitter1.CreateStatic(this,1,2)==NULL) return FALSE;
    m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(CAdv),CSize(rect.Width()/2,rect.Height()),pContext);
    if(m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE,m_wndSplitter1.IdFromRowCol(0,0))==NULL)//从第一次分割的窗口中,再分割
  return FALSE;
m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CMytool),CSize(rect.Width()/2,rect.Height()/2),pContext); 
m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(CInfo),CSize(rect.Width()/2,rect.Height()/2),pContext);  m_wndSplitter1.SetColumnInfo( 0,rect.Width()*23/30,0 );//m_wndSplitter1是父窗口,如果对m_wndSplitter2进行列操作是不能分割这里的列宽度,因为列分割是由m_wndSplitter1产生的。
m_wndSplitter1.RecalcLayout();   return TRUE;//不再调用基类的OnCreateClient函数
// return CFrameWnd::OnCreateClient(lpcs, pContext);
}我按F5,程序窗口出不来,运行一下出现提示,user breakpoint called from code at 0x7c92120e,这是怎么回事啊???

解决方案 »

  1.   

    m_wndSplitter1.SetColumnInfo( 0,rect.Width()*23/30,0 );//
    一般是在OnSize中使用的
      

  2.   

    又试了一下,m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(CAdv),CSize(rect.Width()/2,rect.Height()),pContext);//这句导致出错
    换成:
    m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(CInfo),CSize(rect.Width()/2,rect.Height()),pContext);//就正常。原因在于 CAdv是 public CHtmlView,好象CreateView不能创建CHtmlView类的视图,奇怪了???怎么解决?
      

  3.   

    没有这种现象,可以创建 public CHtmlView的视图的