hi !
i have got a random error ( application crash) when my client use the richeditcontrol :
Visual BasicConsultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.
************** Texte de l'exception **************
System.ArgumentOutOfRangeException: L'index était hors limites. Il ne doit pas être négatif et doit être inférieur à la taille de la collection.
Nom du paramètre : index
à System.ThrowHelper.ThrowArgumentOutOfRangeException()
à DevExpress.Office.UndoableIndexBasedObject`2.get_InfoCore()
à DevExpress.Office.UndoableIndexBasedObject`2.get_Info()
à DevExpress.XtraRichEdit.Model.CharacterPropertiesMerger..ctor(CharacterProperties initialProperties)
à DevExpress.XtraRichEdit.Model.TextRunBase.GetMergedCharacterProperties()
à DevExpress.XtraRichEdit.Model.TextRunBase.get_MergedCharacterFormattingCacheIndex()
à DevExpress.XtraRichEdit.Model.TextRunBase.get_MergedCharacterFormatting()
à DevExpress.XtraRichEdit.Model.VisibleTextFilter.IsRunVisibleCore(RunIndex runIndex)
à DevExpress.XtraRichEdit.Model.VisibleTextFilter.IsRunVisible(RunIndex runIndex)
à DevExpress.XtraRichEdit.SpellChecker.SpellCheckerManager.IsRangeVisible(DocumentModelPosition start, DocumentModelPosition end)
à DevExpress.XtraRichEdit.SpellChecker.SpellCheckerManager.ProcessModifiedWord()
à DevExpress.XtraRichEdit.SpellChecker.SpellCheckerManager.OnSelectionChanged(Object sender, EventArgs e)
à System.EventHandler.Invoke(Object sender, EventArgs e)
à DevExpress.XtraRichEdit.Model.DocumentModel.RaiseInnerSelectionChanged()
à DevExpress.XtraRichEdit.Model.DocumentModel.OnSelectionChanged(Object sender, EventArgs e)
à DevExpress.XtraRichEdit.Model.Selection.OnSelectionChanged(Object sender, EventArgs e)
à DevExpress.XtraRichEdit.Model.SelectionItem.RaiseChanged()
à DevExpress.XtraRichEdit.Model.SelectionItem.OnChangedCore()
à DevExpress.XtraRichEdit.Model.SelectionItem.DevExpress.Utils.IBatchUpdateHandler.OnLastEndUpdate()
à DevExpress.Utils.BatchUpdateHelper.EndUpdate()
à DevExpress.XtraRichEdit.Model.Selection.EndUpdate()
à DevExpress.XtraRichEdit.Model.DocumentModel.OnEndUpdate()
à DevExpress.Utils.BatchUpdateHelper.EndUpdate()
à DevExpress.XtraRichEdit.Commands.Internal.PlaceCaretToPhysicalPointCommand.ExecuteCore()
à DevExpress.XtraRichEdit.Mouse.DefaultMouseHandlerState.BeginCharacterSelectionCore(RichEditHitTestResult hitTestResult)
à DevExpress.XtraRichEdit.Mouse.DefaultMouseHandlerState.BeginCharacterSelection(RichEditHitTestResult hitTestResult)
à DevExpress.XtraRichEdit.Mouse.DefaultMouseHandlerState.HandleMouseDown(RichEditHitTestResult hitTestResult)
à DevExpress.XtraRichEdit.Mouse.DefaultMouseHandlerState.HandleMouseDown(Point physicalPoint)
à DevExpress.XtraRichEdit.Mouse.DefaultMouseHandlerState.OnMouseDown(MouseEventArgs e)
à DevExpress.Utils.MouseHandler.HandleMouseDown(MouseEventArgs e)
à DevExpress.Utils.MouseHandler.OnMouseDown(MouseEventArgs e)
à DevExpress.Services.Implementation.MouseHandlerService.OnMouseDown(MouseEventArgs e)
à DevExpress.XtraRichEdit.Internal.InnerRichEditControl.OnMouseDown(MouseEventArgs e)
à DevExpress.XtraRichEdit.RichEditControl.OnMouseDown(MouseEventArgs e)
à System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à DevExpress.XtraRichEdit.RichEditControl.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
hard for me to give you more details or an example for reproduce the bug…
i have search in the forum and it seems that you have many problems with ThrowArgumentOutOfRangeException and UndoableIndexBasedObject`2
After the internal error , the richeditcontrol is no more accessible and blank ( like in suspendlayout)
thanks for help.
Thomas
Hello Traineau,
I understand that you are currently using version 15.1.7. A similar exception was reported in the past, however, this issue was fixed starting with version 13.2.1. Please refer to the following thread:
Styles - Application crashes when trying to modify newly added CharacterStyle twice
Currently, I don't have any ideas on what can cause this issue in version 15.1.7. We need some additional information about it. For example, what end-user actions result in this issue? How is RichEditControl used in an application (in what container a RichEditControl instance is located)? Is this issue related to specific document content?
It will be very useful for us if you can share such a document or test project with us.
The fact is that it is difficult to diagnose such issues without having an opportunity to replicate and research them locally.
I am looking forward to your response.
Thanks for help,
i have no idea what the final client has made. (but 5 errors in the same day)
the richedit is used in a tabcontrol :
- unit : centimer
- activeviewtype = simple
- only "basic and short" rtf text
i have try to stop spellchecker and autocorrect service ( but still the same error)
why there is no exception handling in the UndoableIndexBasedObject`2 functions ?
Hello Traineau,
According to the provided call stack, the exception is raised from the CharacterPropertiesMerger constructor:
public CharacterPropertiesMerger(CharacterProperties initialProperties) : base(new MergedCharacterProperties(initialProperties.Info.Info, initialProperties.Info.Options)) { }
Either a null reference is passed to this constructor or the CharacterProperties.Info is null. In a common scenario, neither of the mentioned variables should be null.
Even if we add a null reference checking to this constructor, it does not resolve the issue and you can get another (or the same) exception in another code. To resolve this issue, we need to determine the exact (source) cause of the issue. This way we can either provide you with an appropriate solution to avoid it or add corresponding modifications to corresponding places of our source code (not simply add a patch) to fix the issue.
That is why we need a capability to reproduce the issue. We can assume that in your scenario, the RichEditControl instance can be incorrectly disposed of when an end-user performs some actions.
However, this is only an assumption. As I previously mentioned, we need additional information regarding this issue, like: exact end-user operations, a test document, a test project, etc.
We would really appreciate it if you provide us with this information (especially a test project). This way, we can determine the exact cause of the problematic behavior.
i am agree with you except that :
"Even if we add a null reference checking to this constructor, it does not resolve the issue"
that's right but if you add a check … the application would not crash and a message more explicit could help me and the user.
the problem is after your internal "bug", the control is totaly blank ( in suspendlayout i think) and no more action can't be done to it.
I use the same richeditcontrol in the application (no disposing)
i will try to reproduce the problem, and keep you inform.
thanks
Hello Traineau,
In fact, even if we add null reference checking to the mentioned constructor, there can be another "NullReference" exception, without any additional detailed message. Instead of adding such patches for each exception case, it is more correct to determine the exact cause of the issue and fix it.
Also, it is not quite clear whether the issue is caused by some bottlenecks in our source code, or the cause of the issue lies in the specifics of the scenario in which the RichEditControl is used. We would really appreciate if you can stably reproduce the issue and provide us with a corresponding sample project so that we can replicate the problematic behavior on our side.
We are looking forward to your response.
here is a project file with the error :
click on "button1" => "button2" => "button1" => click in the richedit =>ERROR
the problem occurs when the richedit has a spellchecker, the error is causing with the RTF of ressource.string2 i think.
Thanks
Hello Traineau,
Thank you for your project, I was able to reproduce this exception.
I passed this ticket to our developers for further research. Please bear with us. We will notify you as soon as we make any progress.