Link to home
Start Free TrialLog in
Avatar of MarkOttoSmith
MarkOttoSmith

asked on

Syntax Highlighting for CRichEditView

I am trying to create a program in VC6.0. SDI App on Win98.  Trying to create a simple syntax highligher for the perl scripting I do.  

I can't see to find how to make it call my function when the text is changed. That way I would do that syntax highlight again.


BOOL CPerlScripterView::PreTranslateMessage(MSG* pMsg)
{
     if (n == 258){ // found the number by monitoring the messages and this one seamed to be passed when ever a key was pressed
          ...
     }
     return CRichEditView::PreTranslateMessage(pMsg);
}

void CPerlScripterView::OnEditPaste()
{
     GetRichEditCtrl().Paste();
     ...
}

void CPerlScripterView::OnEditCut()
{
     GetRichEditCtrl().Cut();
     ...
}

this seams to work but it doesn't take care of everything that can happen, for example someone uses the replace text option.

Is there a window message like EM_CHANGE.. I belive that works for CEditView.
Avatar of migel
migel

Hi!
Can you check www.codeguru.com and www.codeproject com? there are several syntax  highlighers at this sites you can choose from RichEdit based and Pure CWnd derived ones.
Please remain active in your questions here and provide feedback to the Experts who help you.  If more is needed, let them know.
Thank you,
Moondancer - EE Moderator
MarkOttoSmith has not responded to my request of 4/27/02, nor to help posted by Experts.  It looks like this is left in my hands to finalize.

Expert input is appreciated here so I can be fair in the finalization of this question.

Thanks,

Moondancer - EE Moderator
Hmm
Can be point to the existing solition accepted as answer?
Avatar of MarkOttoSmith

ASKER

no solution was suggested. But i managed to find out using the msdn that by doing something like

long eventmask = GetRichEditCtrl().GetEventMask() | ENM_CHANGE;
GetRichEditCtrl().SetEventMask( eventmask );

then the ON_CONTROL_REFLECT(EN_CHANGE, OnChanged)
would call OnChange when the doc changed
ASKER CERTIFIED SOLUTION
Avatar of Moondancer
Moondancer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial