How does CTreeCtrl::DeleteItem work? 
Author Message
 How does CTreeCtrl::DeleteItem work?

Hello.

This is a easy question to ask, and I hope that for some of you it is a
eaqual easy question to answer.

I have my own classes conneted to items in a treectrl. This classes are
inserted by using SetItemData(new MyClass() ). (this i a little bit
simplified)

Now what I'm woundring about is if CTreeCtrl item do a delete on its data
when the item is deletet, or do I have to do this manually?
Normally I would thing that it dit not, but alle the MFC classes that dont
delete their data, normally has this explicity written in the class
description. I havent fount anything like this in the tree ctrel
description.

I would be glad if someone could give me a hint on this.
(if you are so kind to responce, please send me a CC by mail:

--

Trond-Eirik Kolloen
Elanders Publishing AS

-------------------------------------------------------
Tlf work: 22.63.62.89, Fax work: 22.63.65.91, Tlf priv: 22.28.23.91



Mon, 31 Jul 2000 03:00:00 GMT  
 How does CTreeCtrl::DeleteItem work?

Check out TVN_DELETEITEM

Trond-Eirik Kolloen heeft geschreven in bericht

Quote:
>Hello.

>This is a easy question to ask, and I hope that for some of you it is a
>eaqual easy question to answer.

>I have my own classes conneted to items in a treectrl. This classes are
>inserted by using SetItemData(new MyClass() ). (this i a little bit
>simplified)

>Now what I'm woundring about is if CTreeCtrl item do a delete on its data
>when the item is deletet, or do I have to do this manually?
>Normally I would thing that it dit not, but alle the MFC classes that dont
>delete their data, normally has this explicity written in the class
>description. I havent fount anything like this in the tree ctrel
>description.

>I would be glad if someone could give me a hint on this.
>(if you are so kind to responce, please send me a CC by mail:

>--

>Trond-Eirik Kolloen
>Elanders Publishing AS

>-------------------------------------------------------
>Tlf work: 22.63.62.89, Fax work: 22.63.65.91, Tlf priv: 22.28.23.91




Mon, 31 Jul 2000 03:00:00 GMT  
 How does CTreeCtrl::DeleteItem work?

Quote:
> Hello.

> This is a easy question to ask, and I hope that for some of you it is a
> eaqual easy question to answer.

> I have my own classes conneted to items in a treectrl. This classes are
> inserted by using SetItemData(new MyClass() ). (this i a little bit
> simplified)

> Now what I'm woundring about is if CTreeCtrl item do a delete on its data
> when the item is deletet, or do I have to do this manually?
> Normally I would thing that it dit not, but alle the MFC classes that
dont
> delete their data, normally has this explicity written in the class
> description. I havent fount anything like this in the tree ctrel
> description.

> I would be glad if someone could give me a hint on this.
> (if you are so kind to responce, please send me a CC by mail:


Trond-Eirik,

If I remember right, you can't explicitly associate objects with a tree
item. You do it implicitly with a DWORD ("LPARAM"). Therefore, since it
does not know if this is a pointer, it can't delete it. (And it does not
have to be explicitly stated in the docs)

Does that answer your question?

cU
--

                        http://djuga.home.ml.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Retriever 1.0 is out:   http://retriever.home.ml.org

Shareware image viewer, thumbnailer & database
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Mon, 31 Jul 2000 03:00:00 GMT  
 How does CTreeCtrl::DeleteItem work?


Quote:
>> Hello.

>> This is a easy question to ask, and I hope that for some of you it is a
>> eaqual easy question to answer.

>> I have my own classes conneted to items in a treectrl. This classes are
>> inserted by using SetItemData(new MyClass() ). (this i a little bit
>> simplified)

>> Now what I'm woundring about is if CTreeCtrl item do a delete on its data
>> when the item is deletet, or do I have to do this manually?
>> Normally I would thing that it dit not, but alle the MFC classes that
>dont
>> delete their data, normally has this explicity written in the class
>> description. I havent fount anything like this in the tree ctrel
>> description.

>> I would be glad if someone could give me a hint on this.
>> (if you are so kind to responce, please send me a CC by mail:

>Trond-Eirik,

>If I remember right, you can't explicitly associate objects with a tree
>item. You do it implicitly with a DWORD ("LPARAM"). Therefore, since it
>does not know if this is a pointer, it can't delete it. (And it does not
>have to be explicitly stated in the docs)

The data msut be deleted manually.  One way might be to respond to the
TVN_DELETEITEM message.  The DELETEITEMSTRUCT passed with this message
contains the item data set by SetItemData.




Mon, 31 Jul 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CTreeCtrl with DeleteItem

2. CTreeCtrl::DeleteItem Recursive?

3. HELP CTreeCtrl : OnGetdispinfo doesn't work in CTreeCtrl derived class

4. CTreeCtrl is not doing the business

5. Where is the rough work done?

6. Done it - Quick C now works

7. CTreeCtrl in a CFormView , it doesnt work

8. CDialogBar with CTreeCtrl like in VC working range

9. Working with Tree control (CTreeCtrl)

10. ListView React to DeleteItem, ChangingItem

11. Strnage behaviour with CListCtrl::DeleteItem

12. Access Violation on DeleteAll() or DeleteItem()

 

 
Powered by phpBB® Forum Software