This is the discussion forum for the HtmlEditor. See also the
HtmlEditor home page, where you can download the control, and the
Documentation Wiki, a collaborative project for documenting the control.
Posted by: Bob Lail
Date: Wednesday, 24-May-2006, 13:29:27
I have been getting AccessViolationExceptions for some time with the HtmlEditor. I thought the problem was with mshtml, but they continue in the new version. I think they are always thrown by the message loop of the form that owns the HtmlEditor. They do not recur predictably. What might I be doing wrong?
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
Posted by: Tim
Date: Thursday, 25-May-2006, 15:52:37
Right, so another interesting question is whether you still see the exception if you turn off "break on win32 exceptions"?
The *safest* place to call LoadDocument is in the handler for ReadyStateChanged, after it indicates "complete". In order to make sure that it fires, call LoadUrl("About:Blank") in your form's initialization routines.
Having said that, it shouldn't be necessary. The HtmlEditor should manage this for you. Try it though...