Re: Debugging macros

Vadim Zeitlin <[email protected]> Tue, 27 Jan 2026 20:32:03 +0100
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
On Tue, 27 Jan 2026 14:33:47 +0100 Paris Rossano wrote:

PR> Dear all, sorry for the silly question, but it’s not clear to me whether the 
PR> macros in the following context, which should show dialog messages, work if 
PR> called from a secondary thread.
PR> [ https://docs.wxwidgets.org/latest/group__group__funcmacro__debug.html ]

 Yes, they work when called from a non-GUI thread because they use a low
level native function (e.g. ::MessageBox() under MSW) and not wx
facilities.

 Note that you may also define your own assert handler which can use
wxIsMainThread() to check the context in which it is called and do things
differently in the GUI and other threads.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
              https://www.tt-solutions.com/
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCaXkSswAKCRAG6kHeT2we
hqa+AKChVpoUrqXwWb3GeaFet3u4SY+UXQCeKyoXdn1ZkuSvw5aQ5UwQ5PBAFvI=
=Kbcb
-----END PGP SIGNATURE-----