According to the documentation wxNotebook::GetSelection() returns wxNOT_FOUND if no page is selected.
So my question is: Can this happen when the notebook has pages or does this only happen when there are no pages in the notebook?
I thought that, if there is at least one page, it will always have a selection. Or can you unselect the active page, so that a notebook can have pages but none of them are selected? I would think that the one, which is currently shown, is always considered to be selected and you can not show nothing, unless the notebook is empty.