views:

64

answers:

4

I am currently using RichText control in my program. It creates several instances of RichText control (hundreds) because it’s a sticky notes program.

I wish to replace it with a lightweight HTML control which will have functionality similar to RichText control (text formatting, bullets, links, images etc)

Do you know if any free/commercial lightweight HTML control that I can use in my C++/MFC program?

Thanks.

+2  A: 

There is the free HTMLayout engine by Terra Informatica: http://www.terrainformatica.com/htmlayout/main.whtm

It's mostly used as a skinning engine for applications, but there might be an editing mode, too, since they built a WYSIWYG editor with their own library.

SirDarius
A: 

Since you're on Windows, is there any reason you don't want to use the MSHTML control? It's available in MFC through CHtmlView. Since it is used by so much of the other parts of the O/S, the DLLs are likely already loaded, so instantiating it is going to be pretty quick.

We use it in our projects and it has a comprehensive COM API (IWebBrowser) with events feedback too.

I don't know the per-instance memory/CPU cost, so you may need to take some measurements.

There's always WebKit, as used by Apple Safari, Google Chrome and lots of others.

JBRWilkinson
A: 

I hesitate suggesting this because it's essentially a whole framework for one component, but wxWidgets has a very simple and lightweight implementation, wxHTML.

The library can be built with as little or as much as you need, so you should be able to build with just wxHTML and whatever dependencies it requires. As far as I know it can be mixed with MFC without consequence. (Although, if you felt like it, rewriting your whole app in wx would make it cross platform.)

I would stress that it's a very basic implementation, so if you need something more robust it might not be the best. wxWebConnect wraps WebKit in wx if you need a full browser, but at that point there's probably a better, more MFC-centric solution.

If you're feeling especially adventurous and don't want any wxWidgets dependencies but like the lightweight wxHTML, you could always dive into the wxWidgets source and extract the windows-specific code for that control.

(I attempted to link to both the wxWidgets site and wxWebConnect for your reference, but it appears I can only add one link to my post. Google them if you like.)

Evan Cordell
A: 

There's XStandard.

ChrisW