em_setwordbreakproc in MFC
-
IS there a message map entry for this message, or maybe a virtual function has taken its place
-
IS there a message map entry for this message, or maybe a virtual function has taken its place
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 theseEM_*
messages there are corresponding MFC functions which just send the message with some optional parameter processing. So you might for example overrideCEdit::GetSel()
(which sends theEM_GETSEL
message) to add some funcionality. In the case ofEM_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. -
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 theseEM_*
messages there are corresponding MFC functions which just send the message with some optional parameter processing. So you might for example overrideCEdit::GetSel()
(which sends theEM_GETSEL
message) to add some funcionality. In the case ofEM_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.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
-
Add it to some code and see if Visual Studio finds its reference. Or check the relevant section of the MSDN documentation.
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
-
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
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 usuallyTRUE
for a space. -
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