0
votes

I have an object of the my own class and CTreeCtrl. I have opportunity add items to CTreeCtrl like

hTree = treeObject->InsertItem(L"All object", TVI_ROOT);

This code add items with text. Have i opportunity to add items with consist pointer of my object?

2
".... with consist pointer of my object?" Did you mean to set item data like documented here?πάντα ῥεῖ
Yes. Byt i don't see the way add pointer to my itemВалентин Чикунов

2 Answers

2
votes

As @πάντα ῥεῖ suggests, SetItemData is the way to go. The type of the parameter should be DWORD_PTR allowing both 64-bit and 32-bit code to use the data as a pointer. You will have to cast the pointer. Read up on the methods of CTreeCtrl for more information.

0
votes

If you mean with treeObject as a pointer to const object, then only if InsertItem is a const function.