Solved

Syntax Highlighting for CRichEditView

Posted on 2002-04-26
6
313 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
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:migel
Comment Utility
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
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 12

Expert Comment

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

Author Comment

by:MarkOttoSmith
Comment Utility
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
Comment Utility
You found your own solution, thanks for sharing it.

300 points refunded, item closed.

Moondancer - EE Moderator
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 76
fizzArray2 challenge 1 55
zeroMAx challenge 20 76
Detect file exist or not 3 76
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: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now