当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 能不能提供一下以上工具和相关资料 ......
    摘要: 一被访问iis就占用90%多的cpu资源,并不会释放.系统死掉 ......


SDI切分窗体,执行报错

部分代码如下:  
  BOOL   CMainFrame::OnCreateClient(LPCREATESTRUCT   lpcs,   CCreateContext*   pContext)    
  {  
  //*************   将窗体切分成一行两列   ***************    
  if   (   m_wndSplitter.CreateStatic(this,1,2)   ==   NULL   )  
  return   FALSE;  
                    下面的被我屏蔽掉了,  
            编译没问题,执行时出现错误终止程序,提示winsplit.cpp出错,请教是什么错误。

NO.1   作者: ffit

提供本人得代码,供你参考:  
  if   (!m_wndSplitter.CreateStatic(this,   1,   2))  
  {  
  TRACE0("Failed   to   create   splitter   window\n");  
  return   FALSE;  
  }  
   
  //   Get   the   client   rect   first   for   calc   left   pane   size  
  CRect   rect;  
  GetClientRect(&rect);  
   
  //   create   the   left   tree   view   first.  
  if   (!m_wndSplitter.CreateView(0,   0,   RUNTIME_CLASS(CBOXView),   CSize(rect.Width()/3,   0),   pContext))  
  {  
  TRACE0("Failed   to   create   left   pane   view\n");  
  return   FALSE;  
  }  
   
  //   The   right   pane   is   a   frame   which   and   contain   several   different   views.  
  //   The   is   can   be   set   to   active   or   non-active  
  if   (!m_wndSplitter.CreateView(0,   1,   RUNTIME_CLASS(CUserView),   CSize(0,   0),   pContext))  
  {  
  TRACE0("Failed   to   create   right   pane   frame\n");  
  return   FALSE;  
  }  
  //   Set   the   active   view  
  SetActiveView((CView*)   m_wndSplitter.GetPane(0,   0));  
   
  return   TRUE;  
 

NO.2   作者: danielle5256

 
  只执行m_wndSplitter.CreateStatic(this,1,2)   ,程序当然会出错了,把屏蔽去掉,用楼上的代码试试。


    摘要: 现在针对程序员之家的具体情况对这篇文章进行了修改,希望大家提出自己的意见和建议。。。 提问的智慧 copyright (c) 2001 by eric s. raymond 中文版copyleft 2001 by d.h.grand(nobody/ginux) 英文版:http://www.tuxedo.org/~esr/faqs/smart-questions.html 感谢eric的耐......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE