I'm creating virtual list control in CWnd and CDialog class ( using the same
way to create virtual list control and
message handling for LVN_GETDISPINFO notification ).
I use ON_NOTIFY(LVN_GETDISPINFO, IDC_LISTCTRL, OnGetDispInfo) to handle the
message notification.
The LVN_GETDISPINFO works fine in CWnd class ( notification received ) but
never received in CDialog class.
Any help would be greatly appreciated.
Thanks.
Ronny.
Are you sure your message handler is correct?
ON_NOTIFY(LVN_GETDISPINFO, IDC_LIST, OnGetdispinfoList)
AliR.
"Ronny" <lro...@hotmail.com> wrote in message
news:u5$XxBYjK...@TK2MSFTNGP04.phx.gbl...
Yes, I'm sure my message handler is correct because after successfully
tested on a CWnd,
I putting the virtual list control code using copy-paste to a CDialog.
Ronny
Tom
"Ronny" <lro...@hotmail.com> wrote in message
news:u5$XxBYjK...@TK2MSFTNGP04.phx.gbl...
I have solve the problem.
I already do as your suggestion , create the virtual list control through
the resource editor , but it's not working.
Then, I try to move the control creation code from inside OnCreate message
handle into OnInitDialog message handle, and it's work !!!
Is it normal ? Or I doing something wrong ?
Ronny.
Why don't you simplya put a List Control on the dialog in the resource
editor and attach a variable to it?
AliR.
"Ronny" <lro...@hotmail.com> wrote in message
news:uF28fbIk...@TK2MSFTNGP06.phx.gbl...
1. Add a list control to your dialog.
2. Set up the virtual list control OnGetDispInfo() functionality.
3. Set up how you want each column to display on the control (what data is
put into each field).
4. Maintain the data separate from the control in its own object.
You can also set up the size of the list control based on the size of the
object array (where the actual data is stored) so that you don't have to add
anything to the list control (you just tell it how big it is) with the call:
http://msdn.microsoft.com/en-us/library/xb95w29a(VS.80).aspx
I think this is the easiest and most efficient way to work with a list
control.
Tom
"Ronny" <lro...@hotmail.com> wrote in message
news:uF28fbIk...@TK2MSFTNGP06.phx.gbl...
Thanks for both of you ( AliR and Tom ) for explanation.
Ronny.
http://functionx.com/visualc/controls/dialogbox.htm
But the workings are a little mysterious. However, that is part of the
beauty of MFC. You just create the resource in the resource editor and the
dialog manager code creates it from the template for you. I've never had a
problem with this mechanism and it allows you to set up a lot of things that
are maddening to do without it (like control ordering, positioning, etc.) I
would venture to guess that it's safe to say that most of the people using
MFC use this mechanism.
Tom
"Ronny" <lro...@hotmail.com> wrote in message
news:eW2qW$6kKHA...@TK2MSFTNGP06.phx.gbl...
Steve
Ronny.
"Stephen Myers" <""StephenMyers\"@discu...@microsoft.com"> wrote in
message news:OfLQM$8kKHA...@TK2MSFTNGP06.phx.gbl...
That said, I seldom use the wizards to create events or variables. I may do
it once in a project to get one set up, but then I mostly do that coding by
hand. It's pretty easy to do with cut and paste.
Tom
"Ronny" <lro...@hotmail.com> wrote in message
news:OUZvqSgl...@TK2MSFTNGP05.phx.gbl...