Fog Creek Software
Discussion Board




Using the MSHTML widget from VB?

Hi Joel

Since I understand CityDesk uses the MSHTML ActiveX widget that comes with IE... I was wondering if you knew some links about using this control from VB? All the samples I found on MSDN are either C++ or J/JavaScript.

Thank you

Fred
Tuesday, April 13, 2004

Actually we're using the DHTMLed widget, which is slightly older than MSHTML and officially obsolete. I'll be converting from DHTMLed to MSHTML soon.

Either DHTMLed or MSHTML is good for a quick-and-dirty HTML editing box, but if you want to do anything remotely fancy or slick you need to write a lot of code.

As to where to find documentation on this stuff, I don't know of anything other than MSDN.

Joel Spolsky
Fog Creek Software
Tuesday, April 13, 2004

Thx Joel :-) For those interested, it seems like the newer version lets you customize things, while the older, no-longer supporter version is to be used as is.

Fred
Tuesday, April 13, 2004

We originally used DHTMLed because the documentation stated that it was better at preserving whitespace and source code formatting than MSHTML which made no attempt to preserve whitespace.

Over time we learned:
(1) DHTMLed doesn't really preserve formatting very well; when it tries to do this, it has a tendency to insert spaces in bad places, for example, changing
    <b>foo</b>.
by inserting a space before the .
(2) The DHTMLed is not a "live" dom environment in which you can set up triggers and run Javascript, which limits your ability to find out about editing changes while they are happening.

We worked around (1) by writing our own hugely complicated whitespace preservation code which works moderately well but not great. Since we had to write this ourselves anyway we might as well switch to MSHTML.

#2 is the key reason for switching to MSHTML. I have this dream that if we can find out when things are being edited we can mark certain HTML sections as "dirty" so we know which portions of a document have been changed by the user.

Joel Spolsky
Fog Creek Software
Wednesday, April 14, 2004

Thank you for the clarification :-) Too bad there are so few choices available for sthing as important. For those interested, I listed some solutions I came accross:

http://ypsolog.com/docs/comp/other/cms.html
(WYSIWYG Editing Widgets)

Fred
Thursday, April 15, 2004

*  Recent Topics

*  Fog Creek Home