wzhxxj
asked on
The ListView ActiveX Control Version 6.0
I am trying to add an item into the Microsoft ListView Control(version6) which is contained in file mscomctl.ocx.
Its fairly simple in visual basic but I am having trouble in C++ 6.0. Has anyone done this? I am trying to add a CListItem using the Add method but the VARIANT arguements are giving me problems. In addition, I can't seem to find the definition of the VARIANT structure. Where is it??
Its fairly simple in visual basic but I am having trouble in C++ 6.0. Has anyone done this? I am trying to add a CListItem using the Add method but the VARIANT arguements are giving me problems. In addition, I can't seem to find the definition of the VARIANT structure. Where is it??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The VARIANT (tagVARIANT) structure definition is in "oaidl.h". But it looks just easier to use MFC's COleVariant.
ASKER
I have actually tried to use COleVariant but getting pretty well the same results - nothing in the ListView control or application errors. This should be straight forward - maybe thats why I'm so frustrated. Do you know how to add an item into the listview control?
Try the following code line:
m_ListView.GetListItems(). Add(COleVa riant((lon g)1), COleVariant("key"), COleVariant("Text"), NULL, NULL);
m_ListView.GetListItems().