A small percentage of our customers are getting the following
exception:
System.Runtime.InteropServices.MarshalDirectiveException: Marshaler
restriction: Excessively long string.
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid&
clsid, Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense()
at System.Windows.Forms.AxHost.CreateWithLicense(String license)
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
at System.Windows.Forms.AxHost.EndInit()
at Bravestorm.OperatorClient.UI.Html.HtmlEdit.InitializeComponent()
Just briefly, the code is unmodified designer generated code.
Among the components we have an AxDHTMLEdit. The InitializeComponent
method roughly looks like this:
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
this.axDHTMLEditor = new AxDHTMLEDLib.AxDHTMLEdit();
...
((System.ComponentModel.ISupportInitialize)(this.axDHTMLEditor)).BeginInit();
this.SuspendLayout();
...
//
// axDHTMLEditor
//
this.axDHTMLEditor.Dock = System.Windows.Forms.DockStyle.Fill;
this.axDHTMLEditor.Enabled = true;
this.axDHTMLEditor.Location = new System.Drawing.Point(0, 51);
this.axDHTMLEditor.Name = "axDHTMLEditor";
this.axDHTMLEditor.OcxState =
((System.Windows.Forms.AxHost.State)(resources.GetObject("axDHTMLEditor.OcxState")));
this.axDHTMLEditor.Size = new System.Drawing.Size(992, 749);
this.axDHTMLEditor.TabIndex = 0;
this.axDHTMLEditor.DocumentComplete += new
System.EventHandler(this.axDHTMLEditor_DocumentComplete);
this.axDHTMLEditor.onkeyup += new
System.EventHandler(this.axDHTMLEditor_onkeyup);
this.axDHTMLEditor.onkeydown += new
System.EventHandler(this.axDHTMLEditor_onkeydown);
this.axDHTMLEditor.ShowContextMenu += new
AxDHTMLEDLib._DHTMLEditEvents_ShowContextMenuEventHandler(this.axDHTMLEditor_ShowContextMenu);
this.axDHTMLEditor.onmouseup += new
System.EventHandler(this.axDHTMLEditor_onmouseup);
...
((System.ComponentModel.ISupportInitialize)(this.axDHTMLEditor)).EndInit();
this.ResumeLayout(false);
}
How do we solve this issue? |