CMFCPropertySheet progrmmaticaly close

George Yaroshevsky 1 Reputation point
2021-08-20T18:11:49.483+00:00

If some processing in CMFCPropertySheet throws an exception, how to close the app from the catch block?
PropSheet has one button, Cancel, and OnCommand handler.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,782 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. David Lowndes 4,716 Reputation points
    2021-08-20T20:12:36.187+00:00

    If you want to close the property sheet, try using CPropertySheet::PressButton with PSBTN_CANCEL

    0 comments No comments

  2. George Yaroshevsky 1 Reputation point
    2021-08-20T21:58:46.407+00:00

    I tried, it does not work, i closes OnInitDialog and ores next default Property Page.

    What works is SendMessage or PostMessage WM_CLOSE.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.