BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
....
m_bSplitterCreated=true;  //Add this boolean var in CMainFrame 
                                   // and set default value to false in 
                                   // constructor.
return TRUE;
}
void CMainFrame::OnSize(UINT nType, int cx, int cy) 
{
   CFrameWnd::OnSize(nType, cx, cy); //Donnot forgot call base class OnSize.
   CRect rc;
   GetClientRect(&rc);   int w1 = rc.Width() * 2/3;
   int w2 = rc.Width() /3;   if( m_bSplitterCreated )  // Check if the splitter created!!!!
   {        m_wndSplitter1.SetColumnInfo(0, w1, 0);
        m_wndSplitter1.SetColumnInfo(1, w2, 0);        m_wndSplitter1.RecalcLayout();
   }
}