I tried to "implement" a cbMessageBox at a certain position and suddenly C::B didn't run anymore - instead it crashed silently. I realised the following issue with cbMessageBox:
- if cbMessageBox is called PlaceWindow will be called, but:
- if cbMessageBox is called with a NULL parent pointer, PlaceWindow receives the same
- PlaceWindow with thus issue a cbThrow which will raise a cbException which will use a cbMessageBox
- this again will call PlaceWindow with a NULL pointer... and so on...
You get the idea. cbMessageBox is not safe at all time (speaking about construction/destruction phase)... What to do about this?
My suggestion: Change
if(!w)
cbThrow(_T("Passed NULL pointer to PlaceWindow."));
...in PlaceWindow to:
if(!w)
cbThrow(_T("Passed NULL pointer to PlaceWindow."), true);
...which uses a wxSafeShowMessage instead of cbMessageBox... any objections?
Thomas? Yiannis? Others?
With regards, Morten.