Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw "red squiggly line" in CHtmlEditCtrl

I am working on building spellchecking functionality into my app which currently uses MFC's CHtmlEditCtrl control.

Is there a way of drawing one of those "red squiggly lines" that you see under spelling errors on the HTML control, underneath the word that I detect to be a spelling error?

The only way I can think of is to use the actual HTML to apply this style, and then strip it out upon the email being sent. This seems rather messy, as if the user starts applying underline styles to the text they could interfere with it.

Is there a way of doing this with drawing?

Thanks in advance.

like image 709
Raiden616 Avatar asked Feb 11 '16 23:02

Raiden616


1 Answers

The interface you want is IHTMLRenderStyle. You pass this, once filled in, to the AddSegment method of the of the IHighlightRenderingServices interface. Here's an example in (gasp) VB. I've done it in C++, years ago now though, and it worked nicely.

like image 142
Steve Avatar answered Nov 13 '22 21:11

Steve