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() 为空
现在 在 对话中 打开一个 非模式 对话框 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() 为空
...全文
相关推荐
VC++对话框(CDialog)的全屏显示及控件居中显示
在该函数中,我们可以获取屏幕的宽度和高度,并将对话框的大小设置为屏幕的尺寸,代码如下:```cppint CMyDialog::OnInitDialog(){ CDialog::OnInitDialog
对话框(CDialog)里面显示图片(VC++)
```cppclass CDialogSK : public CDialog {public: CDialogSK(CWnd* pParent = NULL); // 构造函数 CDialogSK(UINT
用CDialog实现的消息框MessageBoxST类
```cppvoid CMessageBoxST::OnBnClickedOk(){ EndDialog(IDC_OK);}void CMessageBoxST::OnBnClickedCancel()
Dll中使用资源(CDialog为例)
CDialog{ DECLARE_DYNAMIC(CMyDialog)public: CMyDialog(CWnd* pParent = NULL); // standard constructor
MFC实现STATIC+TEXT控件
= NULL) GetParent()->SendMessage(WM_STATICMOUSE); CStatic::OnMouseMove(nFlags, point);}void CMyStatic


