15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


WM_CLOSE while in CPropertySheet::DoModal results in crash

Mads_G._Houmann@olicom.dk
Thursday, December 12, 1996

Environment: VC++ 4.2b, Windows95

I have come across what I suspect is a bug in the CPropertySheet 
DoModal implementation.

When my application is showing a modal CPropertySheet derived propertysheet 
and it is closed down, the CPropertySheet code crashes.

The skeleton code is the following:

  void CMyFrameWnd::OnMyMenuCommand()
  {
      CMyPropSheet sheet( "Title", this );
->    sheet.DoModal(); 
  }

If the program receives a WM_CLOSE message from an outside source (in this 
case the server program that spawned it) while in DoModal(), it results in 
a failed ASSERT in dlgprop.cpp: line 739 (and a following crash if this is 
ignored).

  BOOL CPropertySheet::ContinueModal()
  {
     // allow CWnd::EndModalLoop to be used
     if (!CWnd::ContinueModal())
         return FALSE;

    // when active page is NULL, the modal loop should end
->    ASSERT(::IsWindow(m_hWnd));
      BOOL bResult = SendMessage(PSM_GETCURRENTPAGEHWND);
      return bResult;
  }

Nothing of this sort happens, if the same thing is tried with a normal 
CDialog derived modal dialog.


-
Mads Houmann
Software Engineer
Olicom A/S, Denmark




Mads_G._Houmann@olicom.dk
Wednesday, January 29, 1997

[Moderator's note: For those of you paying attention, yes, this was
previously posted in December, by Mads, but it got no responses.]

Environment: VC++ 4.2b, Windows95

I have come across what I suspect is a bug in the CPropertySheet 
DoModal implementation.

When my application is showing a modal CPropertySheet derived propertysheet 
and it is closed down, the CPropertySheet code crashes.

The skeleton code is the following:

  void CMyFrameWnd::OnMyMenuCommand()
  {
      CMyPropSheet sheet( "Title", this );
->    sheet.DoModal(); 
  }

If the program receives a WM_CLOSE message from an outside source (in this 
case the server program that spawned it) while in DoModal(), it results in 
a failed ASSERT in dlgprop.cpp: line 739 (and a following crash if this is 
ignored).

  BOOL CPropertySheet::ContinueModal()
  {
     // allow CWnd::EndModalLoop to be used
     if (!CWnd::ContinueModal())
         return FALSE;

    // when active page is NULL, the modal loop should end
->    ASSERT(::IsWindow(m_hWnd));
      BOOL bResult = SendMessage(PSM_GETCURRENTPAGEHWND);
      return bResult;
  }

Nothing of this sort happens, if the same thing is tried with a normal 
CDialog derived modal dialog.


-
Mads Houmann
Software Engineer
Olicom A/S, Denmark





| Вернуться в корень Архива |