Solved

Syntax Highlighting for CRichEditView

Posted on 2002-04-26
6
333 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:MarkOttoSmith
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:migel
ID: 6972901
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.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6973447
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
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7011108
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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:migel
ID: 7011325
Hmm
Can be point to the existing solition accepted as answer?
0
 

Author Comment

by:MarkOttoSmith
ID: 7030913
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
0
 
LVL 1

Accepted Solution

by:
Moondancer earned 0 total points
ID: 7068940
You found your own solution, thanks for sharing it.

300 points refunded, item closed.

Moondancer - EE Moderator
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question