diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 577946bc0b..f174a3d021 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -463,11 +463,11 @@ wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const long cookie; wxTreeItemId childLast, - child = GetFirstChild(last, cookie); + child = GetFirstChild(item, cookie); while ( child.IsOk() ) { childLast = child; - child = GetNextChild(last, cookie); + child = GetNextChild(item, cookie); } return childLast;