Exception in custom parts editor

Editors for WPF Forum

Posted 9 years ago by John Dunn
Version: 10.2.0532
Avatar
I'm getting the following exception in certain situations when using my custom parts editor

at ActiproSoftware.Windows.Controls.Editors.Primitives.RegularExpressions.DfaInputStateProvider.a(Int32 A_0, Int32 A_1, String A_2, Boolean A_3, Int32& A_4)
at ActiproSoftware.Windows.Controls.Editors.MaskedTextBox.ReplaceText(Int32 startIndex, Int32 length, String text)
at ActiproSoftware.Windows.Controls.Editors.Primitives.TextBoxBase.DeleteText(Int32 startIndex, Int32 length)
at ActiproSoftware.Windows.Controls.Editors.Primitives.TextBoxBase.OnExecutedCommand(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()\r\n   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunInternal(Window window)
at ActiproTest.App.Main() in C:\\Users\\jwd\\Documents\\Visual Studio 2008\\Projects\\PciTest\\ActiproTest\\obj\\Debug\\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()"
I've uploaded a sample program that shows the issue here

Placing the cursor at the beginning of the first octect ( 101 ) and hitting the Delete ( not the Backspace ) key will throw the exception.

I'm downloading the latest build of Actipro but if there's a fix for this using 10.2.532 that would be preferable since otherwise I'll have to retest everyplace where I use Actipro controls.

Comments (5)

Posted 9 years ago by John Dunn
Avatar
Just tried with 11.1.540 and it had the same behavior.
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi John,

Thanks for reporting this issue and the sample. We've fixed this issue for the next maintenance release.


Actipro Software Support

Posted 9 years ago by John Dunn
Avatar
Is there any way that I can address this issue in 10.2.532 by making changes in my code?
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi John,

You can try altering your regex to allow "01" (or "001" or "024"). That would probably just get translated to "1" and avoid the underlying issue.


Actipro Software Support

Posted 9 years ago by John Dunn
Avatar
Thanks, that appears to have worked.
The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.