Menu

#334 Possible small bug in SortChildrenCB

v1.0 (example)
open
None
5
2023-06-29
2023-06-01
No

SortChildrenCB receives these arguments and passes them to TVM_SORTCHILDRENCB:
LPTVSORTCB pSort, BOOL bRecurse = FALSE

But MSDN says:
wParam - Reserved. Must be zero.

So I think bRecurse is a mistake, perhaps copied from SortChildren? Not too bad since the default is zero anyway, just can be confusing.

Discussion

  • Nenad Stefanovic

    • assigned_to: Nenad Stefanovic
     
  • Nenad Stefanovic

    This is an unfortunate situation. Documetation is correct, and bRecurse was copied from TreeView_SortChildrenCB macro.

    The best would be to modify the method like this:

    BOOL SortChildrenCB(LPTVSORTCB pSort, BOOL /*bRecurse*/ = FALSE)   // Note: bRecurse is not used
    {
        ATLASSERT(::IsWindow(this->m_hWnd));
        return (BOOL)::SendMessage(this->m_hWnd, TVM_SORTCHILDRENCB, 0, (LPARAM)pSort);
    }
    

    Cheers,
    Nenad

     

Anonymous
Anonymous

Add attachments
Cancel