Link to home
Start Free TrialLog in
Avatar of wzhxxj
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??
ASKER CERTIFIED SOLUTION
Avatar of abk102299
abk102299

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of abk102299
abk102299

The VARIANT (tagVARIANT) structure definition is in "oaidl.h". But it looks just easier to use MFC's COleVariant.
Avatar of wzhxxj

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(COleVariant((long)1), COleVariant("key"), COleVariant("Text"), NULL, NULL);