CTreeView Text Callback
Matt Johnson -- matt.johnson@analog.com
Wednesday, January 24, 1996
Can anybody offer help using LPSTR_TEXTCALLBACK to set CTreeView item
names? I get the ON_NOTIFY_REFLECTION(TV_GETDISPINFO, OnGetDispInfo)
callback and detect that the TVIF_TEXT mask bit is set. I then set
TV_DISPINFO->item.pszText to my text and set LRESULT to TRUE (guess).
This seems to be working for the most part, but I keep getting
strangness that I can't quite pin down. For example, if I run
CFileDialog with OFN_ALLOWMULTISELECT and iterate through the
resulting filenames while inserting them into the treeview, invariably
some strings get nulled out, although the are fine during the
insertion process.
I remember reading someplace about TVIF_TEXT processing requiring the
source string to be valid for two more TVIF_TEXT messages and/or
messing with the mask bits to get things working. There seems to be
only one "example" of this in the samples on the CD, but its all
commented out. The documentation is quite sparse on this topic.
I'm tired of floundering around trying to guess how to use this
feature. Any takers?
I am using MSVC++4.0
Thanks.
matt.johnson@analog.com
Mike Blaszczak -- mikeblas@interserv.com
Sunday, January 28, 1996
On Wed, 24 Jan 96, matt.johnson@analog.com (Matt Johnson) wrote:
>I then set
>TV_DISPINFO->item.pszText to my text and set LRESULT to TRUE (guess).
Don't do that. That is, both don't set the *pResult to TRUE, and don't guess
at things.
>I remember reading someplace about TVIF_TEXT processing requiring the
>source string to be valid for two more TVIF_TEXT messages and/or
>messing with the mask bits to get things working. There seems to be
>only one "example" of this in the samples on the CD, but its all
>commented out. The documentation is quite sparse on this topic.
What specific sample are you referring to? What specific CD are you
referring to?
That requirement is real, and you need to manage it. Maybe it's the root of
your problem.
>Thanks.
What if my answer sucked?
.B ekiM
--
TCHAR szTwoMinutes[] = _T("Down to the box self by your own you go!");
| Вернуться в корень Архива
|