0

I have my own subclassed class for CEDIT as following:

class MyEdit : public CEdit....

I subclassed it in DoDataExchange procedure by DDX_control I hook in this subclassed class ON_CHAR and ON_CHANGE (MyEdit::OnChar, MyEdit::OnChange).

I need hook ON_CHANGE event also in parent dialog, but with subclassing class it does not work.

Is here some way how manually send from MyEdit::OnChange message to dialog?

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
Michal Hadraba
  • 347
  • 1
  • 11
  • 1
    The obvious solution to sending a message to a parent is to use `SendMessage`. If there is a reason why you cannot use that you need to include that into your question. – IInspectable Jan 06 '22 at 22:42

1 Answers1

-1

I have just solved it. I have solved missing EN:CHANGE by using EN_UPDATE event. EN_UPDATE is posting despite sublclassing CEdit...

Shunya
  • 2,344
  • 4
  • 16
  • 28
Michal Hadraba
  • 347
  • 1
  • 11
  • That may (appear to) solve your immediate issue, but isn't an answer to the question s being asked. `EN_CHANGE` and `EN_UPDATE` are notifications sent in response to different events. They cannot be used interchangeably, which this proposed answer seems to suggest. – IInspectable Jan 07 '22 at 12:54
  • Yes, I solved my problem. Partly.. If somebody knows, how to solve it comletely, how to use both events in Control procedure and in dialog procedure also, I like to learn. – Michal Hadraba Jan 07 '22 at 17:09
  • I left a suggestion in a comment to the question, and asked whether you can or cannot use that. It would help if you responded to that question. – IInspectable Jan 07 '22 at 18:46
  • Thanks, I have not seen it. It means, from CEdit procedure send the message explicitly to parent window? – Michal Hadraba Jan 10 '22 at 06:00