class WXDLLEXPORT wxTreeItemId
 {
+    friend bool operator==(const wxTreeItemId&, const wxTreeItemId&);
 public:
     // ctors
         // 0 is invalid value for HTREEITEM
 #endif // WXWIN_COMPATIBILITY_2_4
 
     wxTreeItemIdValue m_pItem;
+    bool operator!() const { return !IsOk(); }
+    operator bool() const { return IsOk(); }
+
 };
 
+inline bool operator==(const wxTreeItemId& i1, const wxTreeItemId& i2)
+{
+    return i1.m_pItem == i2.m_pItem;
+}
+
 // ----------------------------------------------------------------------------
 // wxTreeItemData is some (arbitrary) user class associated with some item. The
 // main advantage of having this class (compared to old untyped interface) is