WinCE中非模态对话框不能关闭的问题

来源:互联网 发布:格兰富水泵选型软件 编辑:程序博客网 时间:2024/05/17 07:56

主要是要重载这个对话框的两个函数,具体如下:

 ptable=new Dranktable();
 ptable->Iputid=nID-3000; 
 ptable->Create(IDD_DRANKTABLE_DIALOG,this);
 ptable->ShowWindow(SW_SHOW);

 

然后重载 Dranktable的两个函数:

 

 virtual void OnCancel();
 virtual void PostNcDestroy();

void Dranktable::OnCancel()//注意这是一个重写的虚函数,需手动添加
{
 DestroyWindow();
}

 

void Dranktable::PostNcDestroy()
{
 // TODO: Add your specialized code here and/or call the base class
 
 CDialog::PostNcDestroy();
 delete this;
}

原创粉丝点击