无边框的非模式对话框//点击cancel按钮无法调用OnDestory销毁窗口//怎么处理
无边框的非模式对话框//点击cancel按钮无法调用OnDestory销毁窗口//怎么办 void test2::OnDestroy(){CDial
无边框的非模式对话框//点击cancel按钮无法调用OnDestory销毁窗口//怎么办
void test2::OnDestroy()
{
CDialog::OnDestroy();
delete this;
// TODO: 在此处添加消息处理程序代码
}
[解决办法]直接调用 DestroyWindow(),
test2 *p = new test2;
p->Create(xxx);
p->DestroyWindow();
delete p;
另外,不要在OnDestroy()中delete this;
[解决办法]DestroyWindow()会触发OnDestroy消息