Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with the ListView class 1

Status
Not open for further replies.

Valius

Programmer
Oct 20, 2000
174
US
If anyone knows how to use the Microsoft List View Control, version 6.0, please let me know. I'm having a hard time with it. What I need to know is how do you insert things into the list. I've got it on report view and I'm trying to use the ListItem/ListItems classes, but I don't know how they relate to the ListView control. If someone could help guide me in the right direction, I would be greatly appreciative. I've already looked over MSDN online in great detail, but I just can't find what I need. Again, any help would be greatly appreciated. Thank you in advance.

Niky Williams
NTS Marketing
 
First get the handle to the ListCtrl, (GetListCtrl)

then use the ListCtrl functions to InsertColumn and InsertItem and SetItemText, etc...

hth
Randy

 
Already tried that, but it says that it doesn't recognize GetListCtrl(). It tells me that GetListCtrl is an undeclared identifier...which usually means you haven't included the header file it needs. This is what I have, is this correct?

ListCtrl& MyLstCtrl=GetListCtrl();

I've been using this, but it says it doesn't recognize it...I thought I was missing the right header, but I've included afxcview.h, but it still says it doesn't recognize it. I'm doing something wrong, I just don't know what. ACK this is soooo frustrating!!!


Niky Williams
NTS Marketing
 
Something I've notices is that there are 2 classes...one named ListView1 and the other named ListView. I'm trying to use the ListView control, but when I make a member variable, it sticks it into the ListView1 class. This particular class does not have the GetListCtrl() function. It has a SetListItems() function, but I'm having heck trying to figgure that one out. Why is VC++ sticking this control on the ListView1 class instead of the ListView class?
 
Figgured out how to use the ListView Class effectivly....but the ListView1 class is still eluding me. Thank you Randy for bringing that back to my memory, it helped a lot. Very much appreciated!!!!

Niky Williams
NTS Marketing
 
I'm having the same exact problem as you. Can you let me know how you inserted items into the listview control?
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top