Discussion:
CDialog::DoModal() Hangs
(too old to reply)
pallavi pathak
2016-10-08 11:46:56 UTC
Permalink
Hi,

I have created a dialogbox "Certdlg". which I am trying to display

if(certDlg.DoModal() == IDOK)
{
valid = 1
}

but this call goes and hangs in CDialog::DoModal(); . I could realise the problem it have is the "Hwnd" , am passing while invoking dlg constructor.

CISCertDlg certDlg(thumbPrint, validFrom, validUntil, parentWnd);

Passing Null, in parentWnd, creates dlg but with no handle to application.

In place of certdlg if MessageboxEx is called then also DoModal hangs while calling messagebox.
Woody
2016-10-09 05:15:56 UTC
Permalink
Suggest you try this:

// In the caller:
CISCertDlg dlg;
dlg.thumbprint=.. // or however you are setting your dialog variables.
dlg.validFrom=..
etc
int result=dlg.DoModal();

// In the dialog class, use the default constructor, which has no arguments.

If this works, you can try constructors with arguments. Since the parent window's handle is a default argument, you can determine what it should be, if you still want to have a constructor as you show.
Loading...