Why would LVM_GETCOUNTPERPAGE return incorrectly?

This is a discussion on Why would LVM_GETCOUNTPERPAGE return incorrectly? within the Windows Programming forums, part of the Platform Specific Boards category; I'm using the LVM_GETCOUNTPERPAGE message to determine how many rows to add and fill the ListView, but it's returning a ...

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    161

    Why would LVM_GETCOUNTPERPAGE return incorrectly?

    I'm using the LVM_GETCOUNTPERPAGE message to determine how many rows to add and fill the ListView, but it's returning a value that's too high every time. It's off by 3 rows and I can't figure out why. It's got LVS_REPORT and LVS_EX_GRIDLINES styles set. It almost seems like it's not accounting for the gridlines. Is that possible?

    Code:
    int PageSize = SendMessage(hMemData,LVM_GETCOUNTPERPAGE,0,0);
        for (iRow = 0; iRow < PageSize; iRow++) {

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    Need more info....

    When are you sending the msg?
    Do you have the right HWND?
    Have you compared the size of each row (from LVM_GETSUBITEMRECT)? (ie if you divide the client area by the height of a single cell)

    Post the minimum code that demonstrates the problem.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. please help [decelaration ended incorrectly]
    By praat in forum C++ Programming
    Replies: 4
    Last Post: 01-10-2013, 02:56 PM
  2. array being printed incorrectly
    By amissot in forum C Programming
    Replies: 4
    Last Post: 12-29-2011, 05:10 AM
  3. if statement is evaluating incorrectly ...
    By Niss in forum C Programming
    Replies: 3
    Last Post: 09-12-2008, 05:39 PM
  4. File I/O - working incorrectly
    By psychopath in forum C++ Programming
    Replies: 6
    Last Post: 02-02-2006, 02:14 PM
  5. declaration terminated incorrectly
    By Clane in forum C++ Programming
    Replies: 4
    Last Post: 03-08-2002, 12:09 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21