Thread: insert item into tree view

  1. #1
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401

    insert item into tree view

    i cant get the tree view control to display items. it just displays a blank window. here's my code:

    Code:
    TV_INSERTSTRUCT tvins;
    TV_ITEM tvi;
    	
    tvi.mask=TVIF_TEXT;
    tvi.pszText="Item";
    
    tvins.hParent=TVI_ROOT;
    tvins.hInsertAfter=TVI_FIRST;
    tvins.item=tvi;
    
    TreeView_InsertItem(hwndTree,&tvins);
    whats wrong?
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Does the program insert the root item initially? Can you see the root item?

    Kuphryn

  3. #3
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    dont worry, i found the problem. i inserted the item in WM_CREATE before the default processing had been done, so thats why nothing happened. its all fine now.
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Immediate programming help! Please!
    By xMEGANx in forum C++ Programming
    Replies: 6
    Last Post: 02-20-2008, 12:52 PM
  2. Retail Outlet Managment System - the 4th
    By Presidentofusa in forum C Programming
    Replies: 3
    Last Post: 11-10-2007, 10:44 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM