Fog Creek Software
Discussion Board




HTML editor control

Does anybody know of a control which is kind of like an HTML editor in an ActiveX?

reqd to interface to Win32 MS C++

S. Tanna
Tuesday, July 08, 2003

microsoft's dhtml edit control

beware: its a pain to work with

Michael H. Pryor
Tuesday, July 08, 2003

Overview & Details: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaredcom/html/cncpt.asp

Jeff MacDonald
Tuesday, July 08, 2003

Actually if you're starting from scratch you might be better off starting with the MSHTML control. Basically, you embed IE in your application, open to a blank page (about:blank), and set the contentEditable property of the body to TRUE. Lo and behold, HTML editing. All the UI (toolbars, etc) is up to you.

Depending on how much you care about the quality of the generated HTML, you might have to do a lot of work. CityDesk probably has tens of thousands of lines of code making the IE control somewhat easier to work with. In the next release of CityDesk we're doing really heroic amounts of work to make sure that we generate standards-compliant xhtml even though the IE control spews out reasonably standards-compliant HTML 4.0.

Joel Spolsky
Tuesday, July 08, 2003

Why not use a RichTextBox for editing the HTML then use the Browser Control (MSHTML or WebBrowser i think it's called) when you switch to View mode?  Or are you thinking more of a point and click WYSIWYG editor like FrontPage?

Dave B.
Tuesday, July 08, 2003

I've collected a number of links to DHTML editors here that may be useful:
http://sastools.com/b2/post/78650389
http://sastools.com/b2/post/79184980

Sanjay Sheth
Tuesday, July 08, 2003

Joel, is it possible to seperate the code you have written to make the IE control pump out nice HTML? You could have a pretty good little product there, I know I would be interested in a component like that (and with the ability to copy and paste from Microsoft Word and lose the bad formatting HTML it adds).

Ben
Wednesday, July 09, 2003

This is more of Webpage tool, so I'm not sure if it works with C++, but I LOVE this:

http://www.interactivetools.com/products/htmlarea/

I've used it on several intranet sites and its free.

Lee
Wednesday, July 09, 2003

I agree with Joel. MSHTML is the way to go. Once you learnt the basics, it is relatively easy to use. Try to avoid frame pages if you can. They may give you headache.

We built up a C++ class to handle the MSHTML interface. We did that on a "demand" base, so it did not slow down development significantly. Also we hook up our program to all running instances of Internet Explorer. This class helps handling those as well, besides the UI.

Las
Wednesday, July 09, 2003

My main concern with MSHTML editor is the kind of ugly HTML it creates when you paste some text from, say, Microsoft Word or IE.

Leonardo Herrera
Wednesday, July 09, 2003

Coincidentally, I'm hacking on an existing textarea editor to plug accessibility compliance into it.  No, its not ActiveX, its all JS and replaces an existing textarea in a HTML page and does work pretty well.

The original is htmlarea at http://www.interactivetools.com/products/htmlarea its open source (BSD)

If the control has to live in a non browser app then I'd consider using a browser control, IE most likely and creating a page with a textarea in it embedding that within a form, its going to be more robust than the editor control which sucks.

Simon Lucy
Thursday, July 10, 2003

Look at this site [from ie click on the link demo] its pretty cool: http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=/downloads/samples/internet/author/html/htmleditor/default.asp

Its a html editor written in dhtml.

smurf975
Thursday, July 10, 2003

I know of the perfect solution; an ActiveX control that saves you all of the hassle fo working with the MS DHTML stuff.  Try the Think HTML Editor ActiveX Control at:

  http://www.thinktechnologies.com/think_html.asp 

It's a fully funtional HTML editor in an ActiveX control.

Andrew Davies
Tuesday, April 06, 2004

*  Recent Topics

*  Fog Creek Home