Thread: CListBox::SetCaretIndex() buggy in Win98?

  1. #1
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856

    CListBox::SetCaretIndex() buggy in Win98?

    This is a problem I've noticed before, but I would like to fix it this time if I can. I have a CListBox used as a logger, so after adding a string I select the bottom item so it will autoscroll down. On my WinXP box SetCaretIndex(GetCount() - 1); works fine, but on my Win98 it doesn't have any effect, so I tried SetCaretIndex(GetCount()) and it scrolls down until the item before the last. What the dillyo?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    from MSDN: LB_SETCARETINDEX

    Microsoft Windows 95/Windows 98/Windows Millennium Edition (Windows Me) : The wParam parameter is limited to 16-bit values. This means list boxes cannot contain more than 32,767 items. Although the number of items is restricted, the total size in bytes of the items in a list box is limited only by available memory.
    That's the only difference I know about...how many items you got in there?

    gg

  3. #3
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Definitely not that many. During my testing I just add enough lines so that the scrollbar appears and it is much fewer than 100 even... Geez, why do I always have problems that no one else ever does...

    Holy crap.. What a flippin moron I am. I just looked at the link to msdn you pasted and read the lparam definition:
    lParam
    If this value is FALSE, the item is scrolled until it is fully visible; if it is TRUE, the item is scrolled until it is at least partially visible.
    The default for SetCaretIndex() is TRUE and I assumed that meant it made it fully visible but apparently I should stop assuming things. Well at least I've found the answer... Thanks, as usual, codeplug.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem w/ color functions && win98 :P
    By DarkMortar in forum C Programming
    Replies: 2
    Last Post: 06-07-2006, 04:45 PM
  2. Startup using STARTUP folder method for winXP & win98
    By hanhao in forum Windows Programming
    Replies: 2
    Last Post: 05-26-2005, 04:59 AM
  3. win98 Unicode dll
    By Benzakhar in forum Windows Programming
    Replies: 2
    Last Post: 01-19-2004, 06:23 PM
  4. C99 standard prog buggy with Linux but not Windows
    By Greenman in forum C Programming
    Replies: 15
    Last Post: 01-06-2004, 04:54 PM
  5. Problem running program in Win98
    By GaPe in forum C Programming
    Replies: 1
    Last Post: 10-19-2003, 12:08 PM