15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CRichEditCtrl in OCX - event not fired.

P. Senthil -- senthilp@geocities.com
Wednesday, January 08, 1997

Environment: VC++ 4.2-flat, Win 95

I'm trying to write a Control in which a CRichEditCtrl-derived class is
dynamically created in the Control's OnCreate.

When I try to override my CMyRichEdtCtrl's EN_CHANGE, the event is not
fired. I've also experimented with EN_UPDATE with no success. The event
is not fired at all. (I did use ClassWizard to generate the events. And
my message map I think is OK. It has ON_CONTROL_REFLECT)

But when I override EN_SETFOCUS, the event is fired correctly. I
understand all these messages use Message reflection. But why is
EN_CHANGE not getting fired? Am I doing something fundamentally wrong?
Or have I got my message reflection fundas wrong?

P. Senthil
-----------------------------------------------------------------------
1, 7th Avenue (West),
7th Main Road,
Dhandeeswaram Nagar,
Velachery,
MADRAS - 600 042.

Mail:  senthilp@geocities.com

Homepage: www.geocities.com/SiliconValley/Heights/6504



Mike Blaszczak -- mikeblas@nwlink.com
Thursday, January 09, 1997

At 21:59 1/8/97 +0530, P. Senthil wrote:
>Environment: VC++ 4.2-flat, Win 95

Please upgrade to 4.2b by installing the patch. 4.2-flat is
compatible only with beta versions of operating system 
components, and as such will end up breaking against released
versions of those components.

>When I try to override my CMyRichEdtCtrl's EN_CHANGE, the event is not
>fired.

Have you set the event mask for the control?  You have to send an
EM_SETEVENTMASK or call SetEventMask() on the control and tell
the control to use the ENM_CHANGE mask if you expect to receive
EN_CHANGE notifications.

>I've also experimented with EN_UPDATE with no success.

Have you set the event mask for the control?  You have to send an
EM_SETEVENTMASK or call SetEventMask() on the control and tell
the control to use the ENM_UPDATE mask if you expect to receive
EN_UPDATE notifications.

>But when I override EN_SETFOCUS, the event is fired correctly.

EN_SETFOCUS isn't affected by the control's mask.

> Am I doing something fundamentally wrong?

Perhaps it's something fundamental that you're _not_ doing.


.B ekiM
http://www.nwlink.com/~mikeblas/      <-- trip report central!
95 Honda VFR-750F / 88 Yamaha FZ-700 (damaged) / 94 Mazda RX-7
Serial #00050!    /      AMA - HRC - VFROC     / Wang Dang Wankel
         I am bored of this talk. It is time now for the dancing!
These words are my own - I do not speak on behalf of Microsoft.






| Вернуться в корень Архива |