Catching MFC exception