Thank you byo: excellent support ;)
I still have to think about the change to new wxToolBar because it introducess one shortcoming.
Wx docs for wxFrame::CreateToolBar() say:
Under Pocket PC, you should always use this function for creating the toolbar to be managed by the frame, so that wxWidgets can use a combined menubar and toolbar. Where you manage your own toolbars, create a wxToolBar as usual.
So it may produce wxToolBar in some platform-specific manner, not always through creating wxToolBar. But I've looked into XRC source code and it creates toolbar using new, so probably this is the best solution for now.
But I still don't see how it could be used outside wxFrame (like in wxAUI). Curent implementation is limited to standard toolbars only and it creates toolbar just like it's done in CreateToolbar. I think that there may still be some problems when you want to use it exernally but I may be wrong :)
From the wxAUI sample program:
wxToolBar* tb1 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxTB_FLAT | wxTB_NODIVIDER);
[...]
m_mgr.AddPane(tb1, wxAuiPaneInfo().
Name(wxT("tb1")).Caption(wxT("Big Toolbar")).
ToolbarPane().Top().
LeftDockable(false).RightDockable(false));
Basically, it creates a wxToolBar using the constructor and it adds it to the wxAuiManager using the AddPane function, without adding the toolbar to the wxFrame directly.
You are right about the issue with Pocket PC. You may let the user choose among two possibilities: adding the toolbar "at the top or left of the frame", as the manual says (in this case wxFrame::CreateToolBar is used), or not (in this case the wxToolBar constructor is used, and it is the user's responsibility to do something useful with the created toolbar, like adding it to the frame using wxFrame::SetToolBar, or adding the toolbar to a wxAuiManager, or whatever).