Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to implement global subclassing

how to implement global subclassing

Scheduled Pinned Locked Moved C / C++ / MFC
delphitutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chethu665
    wrote on last edited by
    #1

    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

    _ 1 Reply Last reply
    0
    • C chethu665

      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

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      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_

      C 1 Reply Last reply
      0
      • _ _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_

        C Offline
        C Offline
        chethu665
        wrote on last edited by
        #3

        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

        _ L 2 Replies Last reply
        0
        • C chethu665

          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

          _ Offline
          _ Offline
          _AnsHUMAN_
          wrote on last edited by
          #4

          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

          C 1 Reply Last reply
          0
          • C chethu665

            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

            L Offline
            L Offline
            Laxman Auti
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • _ _AnsHUMAN_

              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

              C Offline
              C Offline
              chethu665
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups