1 1 模态对话框与非模态对话框 2 //1 3 CChatDlg *pChatDlg = new CChatDlg; //pChatDlg会被释放 4 if (FALSE == pChatDlg->Create(IDD_CHAT_DLG, this)) 5 { 6 return; 7 } 8 pChatDlg->ShowWindow(SW_SHOW); //不show看不到的 9 10 //2 再次点击不能用了 11 12 CChatDlg pChatDlg; //.h 13 if (FALSE == pChatDlg.Create(IDD_CHAT_DLG, this)) 14 { 15 return; 16 } 17 pChatDlg->ShowWindow(SW_SHOW); //不show看不到的 18 19 //3 20 CChatDlg m_ChatDlg; //.h 21 if (m_ChatDlg.m_hWnd == NULL) 22 { 23 if (FALSE == m_ChatDlg.Create(IDD_CHAT_DLG, this)) 24 { 25 return; 26 } 27 28 } 29 m_ChatDlg.ShowWindow(SW_SHOW);