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

 

 ·天啊我的收件箱自动删信    »显示摘要«
    摘要: 今天早晨打开outlook express,发现收件箱内的几千封email都不见了,但其它文件夹里的信都在。这是怎么回事啊?有没有办法把那些信找回来,望各位高手帮忙,我在这里先谢了。 ......
 ·createprocess的问题    »显示摘要«
    摘要: bool createprocess( lpctstr lpapplicationname, // pointer to name of executable module lptstr lpcommandline, // pointer to command line string lpsecurity_attributes lpprocessattributes, // pointer......


Doc/View构架的显示问题

我在Doc/View构架应用程序中用下列语句为何无法显示窗体  
   
  class   MyApp:public   CWinApp  
  {  
  public:  
          BOOL   InitInstance()  
          {  
          CDocument   *doc;  
          CSingleDocTemplate   *DocTemplate;  
          DocTemplate=new   CSingleDocTemplate( //单文件样版类别  
  IDR_MENU1,  
  RUNTIME_CLASS(MyDocument),  
  RUNTIME_CLASS(MyFrame),  
  RUNTIME_CLASS(MyView));  
  AddDocTemplate(DocTemplate); //将文件样版加入应用程序  
  doc=DocTemplate->CreateNewDocument(); //建立新文件  
   
  m_pMainWnd=DocTemplate->CreateNewFrame(doc,NULL);  
  //建立新的视窗框架  
  DocTemplate->InitialUpdateFrame((CFrameWnd*)m_pMainWnd,doc);  
  //起始化View控件  
  m_pMainWnd->ShowWindow(SW_SHOW); //显示视窗  
   
  return   true;  
          }  
  }a_app;  
   
   
  而换成以下语句就可以显示,  
   
  class   MyApp:public   CWinApp  
  {  
  public:  
  BOOL   InitInstance()  
  {  
  CDocument   *doc; //Declare指向文件的Point  
  CSingleDocTemplate   *DocTemplate;  
   
  DocTemplate=new   CSingleDocTemplate(  
  IDR_MENU1,  
  RUNTIME_CLASS(MyDocument),  
  RUNTIME_CLASS(MyFrame),  
  RUNTIME_CLASS(MyView));  
                    AddDocTemplate(DocTemplate);//将SingleDocTemplate控件设给MyApp  
  doc=DocTemplate->CreateNewDocument(); //Create   new   file  
   
  m_pMainWnd=DocTemplate->CreateNewFrame(doc,NULL);  
  //Create   一个Window   frame  
  DocTemplate->InitialUpdateFrame((CFrameWnd*)m_pMainWnd,doc);  
  //Initiative   window   frame控件,并Link   View控件  
  m_pMainWnd->ShowWindow(SW_SHOW); //显示window  
   
  return   true;  
          }  
  }a_app;  
   
  我找了很久没找出差别在哪,请问谁可以帮我找出第一段错在哪里!

NO.1   作者: puppet

没看出差别来

NO.2   作者: jiangsheng

除了注释之外两段代码是一模一样的……

NO.3   作者: jiangsheng

除了注释之外两段代码是一模一样的……


 ·简单的ado问题,要分的快进来    »显示摘要«
    摘要: #import "c:\program files\common files\system\ado\msado15.dll" rename_namespace("adocg") rename("eof", "endoffile") using namespace adocg; 加入ado的dll文件 renam......
» 本期热门文章:

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