Hi, there,
I am having a problem with creating a modeless CDialog.
The CDialog code is:
class ADialog : public CDialog
{
// Construction
public:
ADialog(SomeData* data, CWnd* pParent = NULL): CDialog(IDD_ADIALOG, pParent){
Data=data;
}
BOOL Create(CWnd* pParent=NULL){
return CDialog::Create(IDD_ADIALOG, pParent);
}
protected:
virtual void DoDataExchange(CDataExchange* pDX); virtual void OnOk();
virtual void OnCancel();
virtual void PostNcDestroy();
private:
SomeData* Data;
}
The creation code is:
ADialog* pADlg=new ADialog(data, this);
pADlg->Create(this);
With above code, I cannot make the Dialog show. If I use pADlg->DoModal(), the Dialog shows.
Could someone point out what's wrong with my code.
Thanks a lot.
I am having a problem with creating a modeless CDialog.
The CDialog code is:
class ADialog : public CDialog
{
// Construction
public:
ADialog(SomeData* data, CWnd* pParent = NULL): CDialog(IDD_ADIALOG, pParent){
Data=data;
}
BOOL Create(CWnd* pParent=NULL){
return CDialog::Create(IDD_ADIALOG, pParent);
}
protected:
virtual void DoDataExchange(CDataExchange* pDX); virtual void OnOk();
virtual void OnCancel();
virtual void PostNcDestroy();
private:
SomeData* Data;
}
The creation code is:
ADialog* pADlg=new ADialog(data, this);
pADlg->Create(this);
With above code, I cannot make the Dialog show. If I use pADlg->DoModal(), the Dialog shows.
Could someone point out what's wrong with my code.
Thanks a lot.