[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

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??
0
wzhxxj
Asked:
wzhxxj
  • 3
1 Solution
 
abk102299Commented:
MFC: A COleVariant object encapsulates theVARIANT data type.
0
 
abk102299Commented:
The VARIANT (tagVARIANT) structure definition is in "oaidl.h". But it looks just easier to use MFC's COleVariant.
0
 
wzhxxjAuthor Commented:
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?
0
 
abk102299Commented:
Try the following code line:

m_ListView.GetListItems().Add(COleVariant((long)1), COleVariant("key"), COleVariant("Text"), NULL, NULL);

0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now