Thread: Listview with MDI

  1. #1
    Unregistered
    Guest

    Listview with MDI

    I am using this code to successfully create a listview control in an SDI program. When I try to use the same code in an MDI program, I get the following error: Cannot find window class.

    I have #include'd <commctrl.h> and am linking with comctl32.lib.

    Code:
    hListView = CreateWindowEx(WS_EX_CLIENTEDGE, 
    							WC_LISTVIEW, 
    							NULL, 
    							WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | LVS_REPORT |LVS_EDITLABELS,
    							25, 100, 475, 100,
    							hWnd, 
    							(HMENU)LISTVIEW32, 
    							hInst, 
    							NULL);
    Any thoughts as to what I am doing wrong? Is there something different that needs to be done when using MDI?

    Thanks in advance.

  2. #2
    Unregistered
    Guest
    I think I might have found the answer. I called the InitCommonControls() function in the MDI program. The list view is now visible. I don't call the InitCommonControls() function in the SDI version, but the list view still works ok. Can anyone explain the difference?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ListView Refresh, Update
    By de4th in forum C++ Programming
    Replies: 1
    Last Post: 12-23-2006, 09:13 AM
  2. Replies: 6
    Last Post: 07-10-2006, 12:05 AM
  3. Inserting text into MDI program
    By Rutabega in forum Windows Programming
    Replies: 0
    Last Post: 12-23-2005, 11:25 AM
  4. Troubles with ListView and Toolbar
    By cornholio in forum Windows Programming
    Replies: 8
    Last Post: 11-14-2005, 01:26 AM
  5. Listview??
    By SuperNewbie in forum C# Programming
    Replies: 4
    Last Post: 02-13-2003, 03:34 AM