VC里面新建一个CDialog派生类,
为什么显示的时候
只能用my_Dialog->DoModal();
而用my_Dialog->ShowWindow(SW_SHOW);编译时就有错误?谢谢。

解决方案 »

  1.   

    use CDialog(), Create(IDD_MYDIALOG,...) and ShowWindow(...) together for a modeless dialog box use CDialog(UINT nIDTemplate) and DoModal() for a modal dialog
      

  2.   

    谢谢。
    还有,CRichTextBox test;
          test.setText("test");
    为什么不行啊?
      

  3.   

    自己up一下!
    help……
      

  4.   

    there is no such class CRichTextBox in MFC, but your problem is probably due to the fact that, the window associated with the object is not created yet, so you cannot send window message to it
      

  5.   

    ShowWindow要求你必须已经创建了该窗口,但实际上你如果没有Create就调用ShowWindow的话自然会有问题
    而DoModal时创建了窗口,你在此后ShowWindow应该就没有问题了