how to implement global subclassing
-
-
how to implement global subclassing i have got around 6 controls in a Dlg and to create a subclass for all controls will be cumbersome what to do :) "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
Can you be more specific on what you really want to do, if you want to avoid Subclassing. What's your need? Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_
-
Can you be more specific on what you really want to do, if you want to avoid Subclassing. What's your need? Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_
what i wanted to explain is that i have got a dialog which has 6 edit controls. all controls need subclassing, so can i make one subclass and use it for all the controls.:) "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
-
what i wanted to explain is that i have got a dialog which has 6 edit controls. all controls need subclassing, so can i make one subclass and use it for all the controls.:) "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
I got that from your very first post that you need to subclass the controls on your dialog. Can you be specific on what type of controls are you having on the dialog that need to be subclassed and for what? If you want to process some messages to the control's you can subclass the edit control for once. Say create a class called CXEdit derived from CEdit and then make the control variables for edit boxes of type CXEdit Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_ -- modified at 7:05 Tuesday 20th June, 2006
-
what i wanted to explain is that i have got a dialog which has 6 edit controls. all controls need subclassing, so can i make one subclass and use it for all the controls.:) "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
Just derive the one class from CEdit and use that class for all the controls of type CEdit ..:)
class CEditEx:public CEdit { add extra methods or override the methods of the control. }
use the class as how we use Normal variables.CEditEx m_Name,m_Goal;
Knock out 't' from can't, You can if you think you can :cool: -- modified at 7:07 Tuesday 20th June, 2006 -
I got that from your very first post that you need to subclass the controls on your dialog. Can you be specific on what type of controls are you having on the dialog that need to be subclassed and for what? If you want to process some messages to the control's you can subclass the edit control for once. Say create a class called CXEdit derived from CEdit and then make the control variables for edit boxes of type CXEdit Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_ -- modified at 7:05 Tuesday 20th June, 2006
they are all edit boxes and i need to restrict the alphabets and numbers in edit box .i cant use the PreTranslateMessage since i need to enable a listbox when i press the key .if i use subclasses it will take 6 subclasses .so can i use global subclassing and how to implement it.:-D "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal