Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

wxWidgets argh

16 views
Skip to first unread message

Alf P. Steinbach

unread,
Sep 18, 2018, 8:05:44 PM9/18/18
to
wxTextCtrl(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTextCtrlNameStr)
{
Init();

Create(parent, id, value, pos, size, style, validator, name);
}

`Init` is that thing that Bjarne argued at length against in his
exception-safety-in-the-standard-library appendix to TCPPL 3, if I
recall correctly.

The `Create` function returns a boolean, it doesn't throw. The
constructor doesn't check the result. And it so happens that even a
Microsoft Windows 10 edit control by default is limited to 32K text, so
that creation fails with more than that meager amount of text, so that
the wxWidgets control silently creates with an invalid state, which some
other part of wxWidgets detects LATER ON. :(


Cheers!,

- Alf

Öö Tiib

unread,
Sep 19, 2018, 2:34:45 AM9/19/18
to
It is worth attention that wxWindows architecture was established (and
most of the core framework was written) before standardization of C++.
Code of that era assumed that exceptions and threads do not exist
and safety that is added later is doomed to fit not too well.
0 new messages