Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - WPF RichTextBox control

Reply
 
Old 07-17-2008   #1 (permalink)
Anthony Meehan


 
 

WPF RichTextBox control

Hi,

We've got a WinForms application which uses a WPF Rich Text Box (via
WindowsFormsIntegration) which is failing on certain user's machines, but
works fine on all others. If we clear their NT profile (we use roaming
profiles), the issue goes away. Of course this is not a suitable workaround
for a large number of users.

To ensure it wasn't any other components causing the issue, I created a
simple application that just has the WPF RichTextBox within a WinForms
application and the same exception occurs for the users which can't use our
main application.

The exception is as below. Any help would be appreciated.


Thanks.

NullReferenceException: Object reference not set to an instance of an object.

Stacktrace
at System.Windows.Documents.TextStore.OnGotFocus()
at System.Windows.Documents.TextEditor.OnGotKeyboardFocus(Object sender,
KeyboardFocusChangedEventArgs e)
at
System.Windows.Controls.Primitives.TextBoxBase.OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
at System.Windows.UIElement.OnGotKeyboardFocusThunk(Object sender,
KeyboardFocusChangedEventArgs e)
at
System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object
target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target,
RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source,
RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus,
Int32 timestamp)
at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject
newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld,
Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean
askOld, Boolean askNew)
at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
at System.Windows.UIElement.Focus()
at System.Windows.Documents.TextEditorMouse.MoveFocusToUiScope(TextEditor
This)
at System.Windows.Documents.TextEditorMouse.OnMouseDown(Object sender,
MouseButtonEventArgs e)
at
System.Windows.Controls.Primitives.TextBoxBase.OnMouseDown(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseDownThunk(Object sender,
MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate
genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object
target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target,
RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source,
RoutedEventArgs args, Boolean reRaised)
at System.Windows.ContentElement.RaiseEventImpl(RoutedEventArgs args)
at System.Windows.ContentElement.RaiseEvent(RoutedEventArgs args, Boolean
trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd,
InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y,
Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd,
Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32
msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam,
IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
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 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr
wParam, IntPtr lParam)
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.Application.Run()
at xxx.xxx.xxx.Program.Main(String[] args) in d:\xxx\Program.cs:line 135

My System SpecsSystem Spec
Old 07-28-2008   #2 (permalink)
Samuel Benzaquen


 
 

RE: WPF RichTextBox control

We have the same issue here.
Have you figured out a solution?
My System SpecsSystem Spec
Old 07-29-2008   #3 (permalink)
Anthony Meehan


 
 

RE: WPF RichTextBox control

I haven't got a solution. And as I am a MSDN subscriber I was hoping someone
from Microsoft would have answered by now.

"Samuel Benzaquen" wrote:
Quote:

> We have the same issue here.
> Have you figured out a solution?
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Preserve carriage returns in RichTextBox control .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46