Solved

Syntax Highlighting for CRichEditView

Posted on 2002-04-26
6
339 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
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 
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

 Database Backup and Recovery Best Practices

Join Percona’s, Architect, Manjot Singh as he presents Database Backup and Recovery Best Practices (with a Focus on MySQL) on Thursday, July 27, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7). In the case of a failure, do you know how long it will take to restore your database?

Question has a verified solution.

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

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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

624 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