Click to See Complete Forum and Search --> : Dynamic with out message maps


LHoffman
September 7th, 1999, 12:42 PM
I am creating a series of CEdit boxes in a CWnd. I am creating these CEdit boxes dynamically and storing them in a linked list. I want to determine if one of these CEdit boxes has been modified in any way. I want this to happen the instance the user has started to modified the edit box.

I want to stay away from deriving another class from CEdit and capturing the message using the OnChanged event. I want all of this to happen at run time.

Is there anything I could do????

Thanks
-LHoffman

Praveen
September 7th, 1999, 01:16 PM
Hi
Better option would be to create these edit controls with incremental Ids. For Example when you create the edit controls assign ID_EDIT,ID_EDIT+1 so on till
you create all the edit controls.
For example if you create lets say 100 edit controls. have some member variable to remember this lets say m_nNoOfEdits
Allyou have to do is enter range message handler in parent window to handle messages from all the edit controls in one place
ON_CONTROL_RANGE(EN_CHANGE,ID_EDIT,ID_EDIT+m_nNoOfEdits, /* add your message handler */)

And in message handler you can know what edit control got changed.
I hope this will work.
Good luck

PRAVEEN
September 7th, 1999, 01:16 PM
Hi
Better option would be to create these edit controls with incremental Ids. For Example when you create the edit controls assign ID_EDIT,ID_EDIT+1 so on till
you create all the edit controls.
For example if you create lets say 100 edit controls. have some member variable to remember this lets say m_nNoOfEdits
Allyou have to do is enter range message handler in parent window to handle messages from all the edit controls in one place
ON_CONTROL_RANGE(EN_CHANGE,ID_EDIT,ID_EDIT+m_nNoOfEdits, /* add your message handler */)

And in message handler you can know what edit control got changed.
I hope this will work.
Good luck

LHoffman
September 7th, 1999, 01:21 PM
How would I do this????? Could you go into a little bit more detail????

Thanks
-LHoffman