[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ListView control problem

Posted on 1998-01-20
2
Medium Priority
?
490 Views
Last Modified: 2013-12-03
Can anyone tell me how to insert text into a report listview control i've used this code with little success i'm only getting text in the first column, my listView control consists of 3 columns what am i doing wrong????
thanks a lot.


char *mYtext[] = {"this","is a", "Test"};
 for(i=0;i<3;i++)
         {
          lvi.iItem = i;
          lvi.iSubItem=i;
          lvi.pszText =mYtext[i];
          lvi.cchTextMax=100;
          lvi.iImage=i;
          lvi.lParam=0;
          ListView_InsertItem(GetDlgItem(hwnd,LISTVIEW),&lvi);

         }

0
Comment
Question by:mwebster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
tflai earned 600 total points
ID: 1410214
Try this:

char *mYtext[] = {"this","is a", "Test"};
lvi.mask = LVIF_TEXT | LVIF_IMAGE;
lvi.iItem = 0;
lvi.isubItem = 0;
lvi.pszText = mYtext[0];
lvi.iImage = 0;l
ListView_InsertItem(GetDlgItem(hwnd,LISTVIEW), &lvi);
ListView_SetItemText(GetDlgItem(hwnd,LISTVIEW), 1,                                    mYtext[1]);
ListView_SetItemText(GetDlgItem(hwnd,LISTVIEW), 2,
                                   mYtext[2]);
0
 

Author Comment

by:mwebster
ID: 1410215
by the way you wrong number of args to ListView_SetItemText
but it worked thanx a lot
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question