First step:
Calling DoSomething_1() the application will add 5 tabs and all work fine.
Second step:
Calling DoSomething_2() the application will remove 4 of 5 tabs. (Using Reset() result in a system crash, the system crash also if trying to remove alla the 5 tabs).
Third step:
Calling DoSomething_1() again result in a system crash at the line: tab.Add(....);
Questions:
1) It is correct that tab.Reset() result in a system crash? I must leave one tab ?
2) Adding new tabs after remove is not possible?
3) Can be windows problem? or compiler?
Note that the posted code it's only an abstract.
Thanks a lot.
I might be wrong, but it looks like in DoSomething_2 you do layer.Clear(); while layer[0] is still part of TabCtrl. I believe this is the cause of troubles.