Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Dominique de LAPASSE
Pour ceux que ca interresseraient.....
de Michael K. O'Neill
"I noticed this too. If the list control is created as part of a dialog template (for example) then the HWND of the header control exists inside of the PreSubclassWindow function, whereas if the list control is created dynamically (with a call to CListCtrl::Create()) then it does not.
I solved the problem by PostMessage'ing a user-defined message to myself from inside of the PreSubclassWindow function. In the handler for the user-defined message, the HWND for the header always exists, regardless of how the list control was created, and I subclass the header from inside this handler (and not from inside the PreSubclassWindow function).
I think it works because the user-defined message is posted at the end of the message queue and is therefore handled at a later time, when everything has "settled down" and both the list control and its header both have been created.
Mike"
"Dominique de LAPASSE" a écrit dans le message de news: 4254ee79$0$25055$
Bonjour,
Lors de la creation dynamique d une CListCtrlEx ( derivée de CListCtrl ), Le code suivant est appelé
... et dans GetHeaderCtrl() HWND hWnd = (HWND) ::SendMessage(m_hWnd, LVM_GETHEADER, 0, 0);
la valeur hwnd est egal à NULL, ce qui cause un arret dans le VERIFY
Pourquoi ?
Alors que pour une liste creee en statique, la valeur hwnd est differente
de
NULL;
Faut il specifier quelque chose de precis lors de la creation dynamique de la liste concernant le Header ?
Merci
Dominique
Pour ceux que ca interresseraient.....
de Michael K. O'Neill <MikeAThon2000@nospam.hotmail.com>
"I noticed this too. If the list control is created as part of a dialog
template (for example) then the HWND of the header control exists inside of
the PreSubclassWindow function, whereas if the list control is created
dynamically (with a call to CListCtrl::Create()) then it does not.
I solved the problem by PostMessage'ing a user-defined message to myself
from inside of the PreSubclassWindow function. In the handler for the
user-defined message, the HWND for the header always exists, regardless of
how the list control was created, and I subclass the header from inside this
handler (and not from inside the PreSubclassWindow function).
I think it works because the user-defined message is posted at the end of
the message queue and is therefore handled at a later time, when everything
has "settled down" and both the list control and its header both have been
created.
Mike"
"Dominique de LAPASSE" <dominique.delapasse@wanadoo.fr> a écrit dans le
message de news: 4254ee79$0$25055$8fcfb975@news.wanadoo.fr...
Bonjour,
Lors de la creation dynamique d une CListCtrlEx ( derivée de CListCtrl ),
Le code suivant est appelé
"I noticed this too. If the list control is created as part of a dialog template (for example) then the HWND of the header control exists inside of the PreSubclassWindow function, whereas if the list control is created dynamically (with a call to CListCtrl::Create()) then it does not.
I solved the problem by PostMessage'ing a user-defined message to myself from inside of the PreSubclassWindow function. In the handler for the user-defined message, the HWND for the header always exists, regardless of how the list control was created, and I subclass the header from inside this handler (and not from inside the PreSubclassWindow function).
I think it works because the user-defined message is posted at the end of the message queue and is therefore handled at a later time, when everything has "settled down" and both the list control and its header both have been created.
Mike"
"Dominique de LAPASSE" a écrit dans le message de news: 4254ee79$0$25055$
Bonjour,
Lors de la creation dynamique d une CListCtrlEx ( derivée de CListCtrl ), Le code suivant est appelé