Wow, do I understand well that it causes XP to crash for you as well?
That is really something
Going to investigate.
Mirek
Well, the fix is trivial:
TabCtrl::Item& TabCtrl::Add()
{
Item& t = tab.Add();
t.owner = this;
if(sel < 0)
Set(0);
Layout(); //<<<<<<<<<<<< this was missing...
return t;
}
and the reason why it has crashed XP is that there were some pretty bad numbers going into GDI, as the tab had wrong layout.. (obviously, M$ should take better care there, it looks like another vulnerability).
I have also added Refresh at the end of Layout (so that you do not have to do it manually, that was a bug too).