Click to See Complete Forum and Search --> : how can I make my modal dialog box go away


Danielle Harvey
April 13th, 1999, 10:19 PM
I created a modal dialog box which pops up when I click the SDI child area with the left mouse button. The dialog box has 2 options, forward and backward, both of which lead to different modal dialog boxes.
When I click forward or backward button though, my original control dialog box which had the 2 push button options won't go away. This really drives me nuts! I have appended my code below. Is there anything I can do to remove this 'control' dialog box after I selected a push button?

Any response any one can give me will be greatly appreciated.

void CBloodAlcoholView::OnLButtonDown(UINT nFlags, CPoint point)
{
CControl controlDlg;
controlDlg.DoModal();
}

void CBloodAlcoholView::OnCalculateBackward()
{
CClientDC cDC(this);
cDC.TextOut(10,10,"calculate forward");

CBackward backwardDlg;
backwardDlg.DoModal();
}

void CBloodAlcoholView::OnCalculateForward()
{
CClientDC cDC(this);
cDC.TextOut(10,10,"calculate forward");

CForward forwardDlg;
forwardDlg.DoModal();
}

real name
April 14th, 1999, 01:39 AM
do you need call SendMessage(WM_CLOSE, 0, 0) in OnMyButtonPressed() dialog memeber functions (use class wizard to create them)?