Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LVS_REPORT, LVS_OWNERDATA, LVIF_DI_SETITEM - Doesn't quite work ...

138 views
Skip to first unread message

R.Wieser

unread,
Jun 2, 2014, 5:19:14 AM6/2/14
to
Hello All,

I've used LVS_REPORT and LVS_OWNERDATA to create a virtual listview in
report mode. From that listview I get LVN_GETDISPINFO notifications for
data that it needs for the to-be-displayed fields.

Before I return the requested field contents I add the LVIF_DI_SETITEM flag
into the LVITEMs mask field, which, as far as I can tell from the MSDN info
on it, means the listview should cache the returned data. Alas, it does not
quite seem to (want to) work that way:

1) When the listview is covered (by another app) and uncovered again all the
field contents are re-requested.

2) when the mouse is over the listview I get a steady stream of requests for
the contents of the first column.

My question therefore is: what is going on here ? Did I forget some
required initialisation or did I simply misinterpret the purpose of that
LVIF_DI_SETITEM flag ?

Regards,
Rudy Wieser




Timo Kunze

unread,
Jun 4, 2014, 3:39:14 AM6/4/14
to
Am 02.06.2014 11:19, schrieb R.Wieser:
> My question therefore is: what is going on here ? Did I forget some
> required initialisation or did I simply misinterpret the purpose of that
> LVIF_DI_SETITEM flag ?

Yes, you do. LVIF_DI_SETITEM is intended for lazy-loading *normal* list
views. When inserting items into a list view, you can for instance set
the item text to LPSTR_TEXTCALLBACK. Then the list view will query the
application for the real data whenever the item needs to be drawn. The
app may then use LVIF_DI_SETITEM to tell the list view to store the data
and never ask again.
Virtual list views on the other hand never store any item data. Instead
they'll always query the data from the application.

Regards
Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."

R.Wieser

unread,
Jun 4, 2014, 4:08:03 AM6/4/14
to
Hello Timo,

> > ... did I simply misinterpret the purpose of that
> > LVIF_DI_SETITEM flag ?
>
> Yes, you do. LVIF_DI_SETITEM is intended for
> lazy-loading *normal* list views.

In that case the riddle is solved. Thanks.

:-\ If only the MSDN page regarding that flag and the LVITEM structure it
belongs to would have mentioned it ...

And another 'thank you' for explaining what it does. I was not aware that a
"lazy loading" mechanism was available (not that I have yet needed it, but
knowing its available doesn't hurt).

> The app may then use LVIF_DI_SETITEM to tell the
> list view to store the data and never ask again.

Hmmm .... So if you use LPSTR_TEXTCALLBACK but not LVIF_DI_SETITEM you get
something like a virtual listview. Interresting.

Regards,
Rudy Wieser


-- Origional message:
Timo Kunze <TKunz...@gmx.de> schreef in berichtnieuws
lmmieu$duj$1...@speranza.aioe.org...
> Am 02.06.2014 11:19, schrieb R.Wieser:
> > My question therefore is: what is going on here ? Did I forget some
> > required initialisation or did I simply misinterpret the purpose of that
> > LVIF_DI_SETITEM flag ?
>
> Yes, you do. LVIF_DI_SETITEM is intended for lazy-loading *normal* list
> views. When inserting items into a list view, you can for instance set
> the item text to LPSTR_TEXTCALLBACK. Then the list view will query the
> application for the real data whenever the item needs to be drawn. The
> app may then use LVIF_DI_SETITEM to tell the list view to store the data
> and never ask again.
> Virtual list views on the other hand never store any item data. Instead
> they'll always query the data from the application.
>
> Regards
> Timo
> --
> www.TimoSoft-Software.de - Unicode controls for VB6
> "Those who sacrifice freedom for safety deserve neither."
> "Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
> �berzeugung, dass die demokratischen Kr�fte �berwiegen und sich - auf
> demokratischem Wege - durchsetzen."



0 new messages