CListCtrl difference InsertItem() and SetItemText(0,...) 
Author Message
 CListCtrl difference InsertItem() and SetItemText(0,...)

If I insert an item in a CListCtrl with

iItem = InsertItem(....,"yyyy");

and afterwards

SetItemText(iItem,0,"xxxx");

The text "yyyy" which appears after the InsertItem statement in
the first column is overwritten with "xxxx".
That means this field contents is editable with TWO different functions.

Am I right or what's the difference between these two types of filling
the first column of a item ?

Bye
Monica

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 07 Apr 2002 03:00:00 GMT  
 CListCtrl difference InsertItem() and SetItemText(0,...)
The difference is for InsertItem(...), it adds a column at
the position specified and SetItemText(...) modifies the
text of an existing item.  So you can't use the second for
a column that has not been inserted previously.

Mike

Quote:

> If I insert an item in a CListCtrl with

> iItem = InsertItem(....,"yyyy");

> and afterwards

> SetItemText(iItem,0,"xxxx");

> The text "yyyy" which appears after the InsertItem statement in
> the first column is overwritten with "xxxx".
> That means this field contents is editable with TWO different functions.

> Am I right or what's the difference between these two types of filling
> the first column of a item ?

> Bye
> Monica

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sun, 07 Apr 2002 03:00:00 GMT  
 CListCtrl difference InsertItem() and SetItemText(0,...)
On Wed, 20 Oct 1999 19:34:29 GMT, "Mike"

Quote:

>The difference is for InsertItem(...), it adds a column at
>the position specified

No.  It inserts an item into the list.  CListCtrl::InsertColumn()
inserts a column.

Quote:
>and SetItemText(...) modifies the
>text of an existing item.  So you can't use the second for
>a column that has not been inserted previously.

Again, you are confusing columns with items.  They are not the same
thing.  Take a look at the right-hand pane of Windows Explorer.
"Name", "Type", "Size" and "Modified" are the columns.  The items are
the individual files.

Quote:
>Mike

>> If I insert an item in a CListCtrl with

>> iItem = InsertItem(....,"yyyy");

>> and afterwards

>> SetItemText(iItem,0,"xxxx");

>> The text "yyyy" which appears after the InsertItem statement in
>> the first column is overwritten with "xxxx".
>> That means this field contents is editable with TWO different functions.

>> Am I right or what's the difference between these two types of filling
>> the first column of a item ?

>> Bye
>> Monica

>> Sent via Deja.com http://www.deja.com/
>> Before you buy.

--
Chip
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"Make it idiot-proof and someone will make a better idiot."
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Tue, 09 Apr 2002 03:00:00 GMT  
 CListCtrl difference InsertItem() and SetItemText(0,...)
Let us forget the ill-advice you've been offered, and concentrate on
the original question.

InsertItem does what it says on the tin, whereas SetItemText can be
subsequently used to dynamically change the original text should such
a need arise during the execution of the program. Another use of
SetItemText is to set the texts of the columns associated with an item
(if in details view). But the drill is first InsertItem and then
SetItemText. The other way around just won't work.



Quote:
> If I insert an item in a CListCtrl with

> iItem = InsertItem(....,"yyyy");

> and afterwards

> SetItemText(iItem,0,"xxxx");

> The text "yyyy" which appears after the InsertItem statement in
> the first column is overwritten with "xxxx".
> That means this field contents is editable with TWO different
functions.

> Am I right or what's the difference between these two types of
filling
> the first column of a item ?

> Bye
> Monica

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Thu, 11 Apr 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CListCtrl difference InsertItem() and SetItemText(0,...)

2. difference between InsertItem() and SetItemText()

3. CListCtrl::SetItemText( ) problem

4. probelm with CListCtrl::SetItemText

5. When CListCtrl::SetItemText will not set the text

6. CListCtrl and SetItemText

7. Need help with CListCtrl.SetItemText()

8. CListCtrl.SetItemText()

9. When CListCtrl::SetItemText will not set the text

10. CListCtrl::insertitem problems ...

11. CListCtrl InsertItem fails

12. Error for Getitem and insertitem in CListCtrl

 

 
Powered by phpBB® Forum Software