CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 1999
    Posts
    18

    Dynamic with out message maps

    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


  2. #2
    Join Date
    Apr 1999
    Location
    NJ, USA
    Posts
    25

    Re: Dynamic with out message maps

    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


  3. #3
    Join Date
    Apr 1999
    Location
    NJ, USA
    Posts
    25

    Re: Dynamic with out message maps

    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


  4. #4
    Join Date
    Aug 1999
    Posts
    18

    Re: Dynamic with out message maps

    How would I do this????? Could you go into a little bit more detail????

    Thanks
    -LHoffman



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured