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. em_setwordbreakproc in MFC

em_setwordbreakproc in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++
7 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    IS there a message map entry for this message, or maybe a virtual function has taken its place

    L J 2 Replies Last reply
    0
    • F ForNow

      IS there a message map entry for this message, or maybe a virtual function has taken its place

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Add it to some code and see if Visual Studio finds its reference. Or check the relevant section of the MSDN documentation.

      F 1 Reply Last reply
      0
      • F ForNow

        IS there a message map entry for this message, or maybe a virtual function has taken its place

        J Offline
        J Offline
        Jochen Arndt
        wrote on last edited by
        #3

        There is never a message map entry by "magic". They are added manually or by the class wizard. EM_* are messages send to an edit control for getting or setting properties, or starting specific operations. So there is no need to process these messages by your application and they are not supported by the class wizard. For most of these EM_* messages there are corresponding MFC functions which just send the message with some optional parameter processing. So you might for example override CEdit::GetSel() (which sends the EM_GETSEL message) to add some funcionality. In the case of EM_SETWORDBREAKPROC your application would send this message to the control to pass the address of a function. Then there is no need to handle the message because you can do the necessary operations just before or after sending the message.

        F 1 Reply Last reply
        0
        • J Jochen Arndt

          There is never a message map entry by "magic". They are added manually or by the class wizard. EM_* are messages send to an edit control for getting or setting properties, or starting specific operations. So there is no need to process these messages by your application and they are not supported by the class wizard. For most of these EM_* messages there are corresponding MFC functions which just send the message with some optional parameter processing. So you might for example override CEdit::GetSel() (which sends the EM_GETSEL message) to add some funcionality. In the case of EM_SETWORDBREAKPROC your application would send this message to the control to pass the address of a function. Then there is no need to handle the message because you can do the necessary operations just before or after sending the message.

          F Offline
          F Offline
          ForNow
          wrote on last edited by
          #4

          Let me clarify from the oninitdialog I did editcntl.Sendmessage(EM_SETWORDBREAKPROC,0,(LPARAM)editcntlwordwrap); I had assumed based on the documentation

          Quote:

          A Wordwrap function defines the point at which the system should break a line of text for multiline edit controls, usually at a space character that separates two words

          that when I would type in a space my call back function would get control, this didn't happen. However I kept on typing and when I did get to the end of the line my call back function did get control

          J 1 Reply Last reply
          0
          • L Lost User

            Add it to some code and see if Visual Studio finds its reference. Or check the relevant section of the MSDN documentation.

            F Offline
            F Offline
            ForNow
            wrote on last edited by
            #5

            let me clarify from the oninitdialog I did editcntl.Sendmessage(EM_SETWORDBREAKPROC,0,(LPARAM)editcntlwordwrap); I had assumed based on the documentation

            Quote:

            A Wordwrap function defines the point at which the system should break a line of text for multiline edit controls, usually at a space character that separates two words

            that when I would type in a space my call back function would get control, this didn't happen. However I kept on typing and when I did get to the end of the line my call back function did get control

            L 1 Reply Last reply
            0
            • F ForNow

              Let me clarify from the oninitdialog I did editcntl.Sendmessage(EM_SETWORDBREAKPROC,0,(LPARAM)editcntlwordwrap); I had assumed based on the documentation

              Quote:

              A Wordwrap function defines the point at which the system should break a line of text for multiline edit controls, usually at a space character that separates two words

              that when I would type in a space my call back function would get control, this didn't happen. However I kept on typing and when I did get to the end of the line my call back function did get control

              J Offline
              J Offline
              Jochen Arndt
              wrote on last edited by
              #6

              How is that related to your initial question about a message map entry or a virtual function for this message? What you have quoted describes what the function usually does. I have never used it but would expect that it is called when required (e.g. every time when reaching the line limit while typing and when "the user presses arrow keys in combination with the CTRL key to move the caret to the next word or previous word"). Have a look at the EditWordBreakProc callback function (Windows)[^]. It describes the actions passed to the callback function which indicate when it is called. But it does not matter when it is called. You just have to return a value according to the requested action. For the case of word break checks (WB_ISDELIMITER), the return value is usually TRUE for a space.

              1 Reply Last reply
              0
              • F ForNow

                let me clarify from the oninitdialog I did editcntl.Sendmessage(EM_SETWORDBREAKPROC,0,(LPARAM)editcntlwordwrap); I had assumed based on the documentation

                Quote:

                A Wordwrap function defines the point at which the system should break a line of text for multiline edit controls, usually at a space character that separates two words

                that when I would type in a space my call back function would get control, this didn't happen. However I kept on typing and when I did get to the end of the line my call back function did get control

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                ForNow wrote:

                I had assumed

                Not how I understand that note. It only makes sense to call the function at the point that a break is likely to occur, not for every space character.

                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