HtmlEditor :  Phorum 5 The fastest message board... ever.

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.

Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
AccessViolationException
Posted by: Bob Lail (---.lcms.org)
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?

Thanks!
Bob


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)
at System.Windows.Forms.Form.ShowDialog()

Re: AccessViolationException
Posted by: Tim (---.gotadsl.co.uk)
Date: Thursday, 25-May-2006, 10:02:49

Can you reproduce the error in a simple app you can upload?

Do you have code that is manipulating the document before it is ready?

Is Visual Studio set to break on win32 exceptions? That can help to narrow it down.

Tim

Re: AccessViolationException
Posted by: Bob Lail (---.lcms.org)
Date: Thursday, 25-May-2006, 15:00:50

"Do I have code that is manipulating the document before it is ready?"

What would that look like?

When should I call LoadDocument?

Thanks, Tim.

PS I do break on win32 exceptions. I could upload a sample app; but the error isn't reliable. It occurs something like 10% of the time.

Re: AccessViolationException
Posted by: Tim (---.gotadsl.co.uk)
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...

Tim



Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically.
bYTkh
This is a moderated forum. Your message will remain hidden until it has been approved by a moderator or administrator
This forum powered by Phorum.