Thread: ListView is not working!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158

    ListView is not working!

    When I put this code under my WM_CREATE area, the listview is displayed as a big empty white client-edged box. Why is this not making the columns?
    Code:
             InitCommonControls();
             CreateCtrl(WC_LISTVIEW, NULL, WS_VSCROLL, WS_EX_CLIENTEDGE, ID_LIST, 0, 0, 0, 0);
             lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
             lvColumn.fmt = LVCFMT_LEFT;
             lvColumn.cx = 100;
             lvColumn.pszText = "File Name";
             ListView_InsertColumn(GDI(ID_LIST), 0, &lvColumn);
             ListView_Update(GDI(ID_LIST), 0);
             lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
             lvColumn.fmt = LVCFMT_LEFT;
             lvColumn.cx = 100;
             lvColumn.pszText = "File Size";
             ListView_InsertColumn(GDI(ID_LIST), 1, &lvColumn);
             ListView_Update(GDI(ID_LIST), 1);
    CreateCtrl() is a working macro I made. So is GDI(). And I have the program set the size of it under WM_SIZE, which is also working great. I have already tried it with and without the update calls.

    EDIT:
    I changed ListView_SetColumn() to ListView_InsertColumn() but it's still not working. Please help.

    EDIT 2:
    Okay, nevermind, I see now. I was under the impression that the "SysHeader32" class was a part of the "SysListView32" class. Sorry for the bunk thread.
    Last edited by Yarin; 09-02-2007 at 10:20 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ListView & ImageLists
    By @nthony in forum Windows Programming
    Replies: 2
    Last Post: 07-16-2006, 04:44 PM
  2. Replies: 6
    Last Post: 07-10-2006, 12:05 AM
  3. Troubles with ListView and Toolbar
    By cornholio in forum Windows Programming
    Replies: 8
    Last Post: 11-14-2005, 01:26 AM
  4. Problems setting selection in listview window
    By PJYelton in forum Windows Programming
    Replies: 4
    Last Post: 04-12-2005, 07:37 PM
  5. Listview with c/c++
    By X PaYnE X in forum Windows Programming
    Replies: 8
    Last Post: 03-20-2005, 11:29 PM