OnNcDestroy()函数不是由你主动去调用的,请看一下它的帮助。This method is called by the framework when the nonclient area is being destroyed, and is the last method called when the Windows CE window is destroyed. The default implementation performs some cleanup, then calls the virtual method PostNcDestroy. Override PostNcDestroy if you want to perform your own cleanup, such as a delete this operation. If you override OnNcDestroy, you must call OnNcDestroy in your base class to ensure that any memory internally allocated for the window is freed.
在ExitInstance()加入 if (m_pMainWnd!=NULL)
{
delete m_pMainWnd;
m_pMainWnd = NULL;
}
CWnd *m_pMainWnd = (CWnd*)RUNTIME_CLASS(CWnd)->CreateObject();
m_pMainWnd->Create(........);
{
delete this;
}
把代码拿来大家瞅瞅,好给你说说呀,不然就空对空
OnNcDestroy()函数不是由你主动去调用的,请看一下它的帮助。This method is called by the framework when the nonclient area is being destroyed, and is the last method called when the Windows CE window is destroyed. The default implementation performs some cleanup, then calls the virtual method PostNcDestroy. Override PostNcDestroy if you want to perform your own cleanup, such as a delete this operation. If you override OnNcDestroy, you must call OnNcDestroy in your base class to ensure that any memory internally allocated for the window is freed.