CTreeVtrl

Hi,

i have quite long text for each item which is to be added to the CTreeCtrl.
say there are 8 lines in a file, and 4 lines is one item. so now i use:

//"line" is one line
for (i=0i<=3;i++){
strcpy(item,line);
strcat(item,"\n");
}

but i always get the 4 lines be displayed in one line in the CTreeCtrl. and there are some strange characters in between.

could anyone pls help??

thanks a lot!
greenbirdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vinayak KumbarSr Program ManagerCommented:
Hi,

I don't think U can have more than one line for one item. U can make each line as an item.

Try with ownerdrawn tree control and such things.
VinExpert
0
greenbirdAuthor Commented:
Hi,

how to not set image for an item ? coz for the other 3 lines, i think can display without the image, then it is ok.

thanks a lot!
0
anoopsCommented:
For not showing an image use the "mask"
member of TVITEM structure when you use the InsertItem() method of CTreeCtl.( Or the SetItem() method too )..

While inserting the item, if you don't want to have an associated image then remove TVIF_IMAGE and TVIF_SELECTEDIMAGE flags from the 'mask' member of TVITEM structure.

Hope this helps
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
greenbirdAuthor Commented:
Hi,

sorry for delay in replying :)

but when i use InsertItem(), i did not use TVITEM, i use:

hException = m_treeCtrl.InsertItem(TVIF_TEXT,t1, 0, 0, 0, 0, 0, hGeneral, NULL);

so in this case, how to not show the image for it?

Thanks a  lot!
0
greenbirdAuthor Commented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.