CDialog::GetParent() 返回值 NULL
我定义个一个 对话框 A
现在 在 对话中 打开一个 非模式 对话框 B
代码如下
void A::OnCreate(){
BDialog *b=new BDialog (this);
b->Create(IDD_DIALOGBAR2);
b->ShowWindow(SW_SHOW);
if(b->GetParent()==NULL)
{
AFXMessageBox("为空");
}
if(b->GetParent()==this)
{
AFXMessageBox("为 A");
}
}
为什么 b->GetParent() 为空