Getting visual is not connected to a Presentationsource Error While Docking

Posted by: santhosh.balakrishnan on 22 December 2020, 10:45 pm EST

    • Post Options:
    • Link

    Posted 22 December 2020, 10:45 pm EST

    Getting visual is not connected to a Presentationsource Error While Docking the docktabcontrol inside dockcontrol not able to reproduce the issue because it is occurring randomly. Below I have attached the exception details.

    System.InvalidOperationException

    HResult=0x80131509

    Message=This Visual is not connected to a PresentationSource.

    Source=PresentationCore

    StackTrace:

    at System.Windows.Media.Visual.PointToScreen(Point point)

    at #cKb.#cLb.#XKb(Object #F, MouseEventArgs #9l)

    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(DependencyObject sender, RoutedEventArgs args)

    at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

    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, WindowMessage 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, Int32 numArgs)

    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)

    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)

    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

    at System.Windows.Window.ShowHelper(Object booleanBox)

    at System.Windows.Window.ShowDialog()

    at KT.ACE.GUI.AnalyticVisualizerController.OpenAnalyticVisualizer(NodeIdentity nodeIdentity) in E:\Klarity Ace Sources\ACE_DEVELOPMENT 24.0.20\ace_xp\Source\Application\GUI\OutputDisplayManager\AnalyticVisualizerController.cs:line 115

    at KT.ACE.GUI.ACE_Main.ConfigureAnalyticVisualizer()

    at KT.ACE.GUI.ACE_Main.dnbmACE_Main_ItemClick(Object sender, EventArgs e)

    at DevComponents.DotNetBar.DotNetBarManager.8X(BaseItem 2EB)

    at DevComponents.DotNetBar.BaseItem.RaiseClick()

    at DevComponents.DotNetBar.DotNetBarManager.HO(eShortcut 2GN)

    at DevComponents.DotNetBar.DotNetBarManager.8E(IntPtr 2GK, IntPtr 2GL, IntPtr 2GM)

    at DevComponents.DotNetBar.05.N3(IntPtr 2R8, IntPtr 2R9, IntPtr 2RA)

    at System.Windows.Forms.Application.ThreadContext.ProcessFilters(MSG& msg, Boolean& modified)

    at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr 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 KT.ACE.GUI.ACE_Main.Main(String args)

    Thanks & Regards

    B.Santhosh

  • Posted 23 December 2020, 7:27 pm EST

    Hi Santhosh,

    We are sorry but this issue is not reproducible at our end. Could you please share the C1 version you are using?

    In case you are using an old version, could you please try the same with the latest build (4.5.20203.727) and see if the issue happens or not? You can upgrade to the latest build using C1ControlPanel from here :

    https://www.grapecity.com/componentone/download

    Regards,

    Kartik

  • Posted 23 December 2020, 7:47 pm EST

    Hi Karthik,

    We are using 4.5.20202.716, we are also not able to reproduce the scenario exactly so that, i didn't able to create a sample for your reference. I think there is a problem while calling the System.Windows.Media.Visual.PointToScreen(Point point) method while dragging the dockcontrols., what my assumption is, it needs some validation before calling the PointToScreen method, will you please check on it meanwhile, i will try with the latest build.
    

    Thanks & Regards

    B.Santhosh

  • Posted 23 December 2020, 10:13 pm EST

    Hi Santosh,

    I have tried multiple times docking/undocking but the issue didn’t replicate. Could you please try running the attached sample and see if it causes any issues while docking? (see DockControlSample.zip)

    And also are you performing any specific operation during the docking operation? If yes then please make the necessary changes in the attached sample.

    Regards,

    Kartik

    DockControlSample.zip

  • Posted 24 November 2021, 5:09 am EST

    Getting this error in VS 2022 using the DockingExplorer sample downloaded from https://github.com/GrapeCity/ComponentOne-WPF-Samples/tree/master/NET_6/Docking/DockingExplorer

  • Posted 25 November 2021, 10:37 pm EST

    Hello,

    Thank you for the sample reference.

    We are unable to replicate this error at our end i.e., sample is working without any errors.

    We’ve tried docking/undocking also.

    Could you please provide some snapshots of error and StackTrace, So that we can assist you accordingly.

    Regards,

    Nitin

  • Posted 28 November 2021, 3:56 am EST - Updated 3 October 2022, 11:31 pm EST

    Screen Shot attached and StackTrace provided below:

    System.InvalidOperationException

    HResult=0x80131509

    Message=This Visual is not connected to a PresentationSource.

    Source=PresentationCore

    StackTrace:

    at System.Windows.Media.Visual.PointToScreen(Point point)

    at C1.WPF.Docking.DockDragDropData.MouseMove(Object sender, MouseEventArgs 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.RaiseTrustedEvent(RoutedEventArgs args)

    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, WindowMessage 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, Int32 numArgs)

    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)

    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)

    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

    at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)

    at System.Windows.Threading.Dispatcher.Run()

    at System.Windows.Application.RunDispatcher(Object ignore)

    at System.Windows.Application.RunInternal(Window window)

    at System.Windows.Application.Run()

    at DockingExplorer.App.Main()

  • Posted 28 November 2021, 5:41 pm EST

    Hello,

    Thanks for the snapshot and stack trace.

    We’re still unable to replicate this behavior at our end. Could you please provide some more information like, if you have made any changes in the sample then share the modified sample. Also share the steps which can replicate this behavior.

    Best Regards,

    Nitin

  • Posted 29 November 2021, 3:50 am EST

    No changes were made to the sample - a very random occurrence, so its hard to provide specific steps to duplicate the error. The error will occur at some point after redocking/floating the tabs - no specific time / no specific tab / no specific dock location / occurs as you undock and drag a tab to a new location.

  • Posted 29 November 2021, 6:09 pm EST

    So I can say that the last couple times I have loaded this project, I am no longer encountering the error and cannot reproduce it - no changes were made to the source file nor my machine - I will report back if the situation changes.

  • Posted 29 November 2021, 6:17 pm EST

    Spoke too soon - the error is back.

  • Posted 29 November 2021, 8:01 pm EST

    Hi,

    Thanks for your patience,

    We still didn’t replicate this behavior at our end. However, we are also discussing this with the development team. We will get back to you once we have any update. [Internal Track Id- C1XAML-28489]

    Best Regards,

    Nitin

  • Posted 1 December 2021, 8:41 pm EST

    Hello,

    Sorry to inform you that, development team is also unable to replicate this behavior.

    Could you please provide some more information like:

    1. Development OS.
    2. Development OS Service Pack
    3. Visual Studio Version
    4. Visual Studio Build
    5. Control(Flexgrid) Build version.

    Regards,

    Nitin

  • Posted 1 December 2021, 9:22 pm EST

    1. Development OS.

    2. Development OS Service Pack

      Edition - Windows 10 Enterprise

      Version - 20H2

      OS build - 19042.1348

      Experience - Windows Feature Experience Pack 120.2212.3920.0

    3. Visual Studio Version

    4. Visual Studio Build

      Microsoft Visual Studio Community 2022 (64-bit)

      Version 17.0.1

    5. Control(Flexgrid) Build version.

      Flexgrid? - that is not included in the solution

      C1.WPF.Docking Build Version - 6.0.20213.140-beta

  • Posted 2 December 2021, 5:12 pm EST

    Hi Glen,

    Thank you for sharing the details.

    We have tested the DockingExplorer sample with shared environment but we are not getting this error. We have also tried the same with multiple VS versions i.e. 17.0.0, 17.0.1, 17.0.2 but the result is still the same.

    Could you please share anything that can be helpful in reproducing this issue? May be you can share the gif so that we can have some idea about the steps.

    JFYI, we couldn’t help much in this case until we know the actual cause of this issue.

    Regards,

    Nitin

  • Posted 9 December 2021, 12:08 am EST

    So I thought I would wait until the official Dec 8th roll out - and I am still getting the error. Here is a link to a video demonstrating the steps taken to produce the error on my machine - again, it occurs randomly, but the steps shown in the video seem to be able to reproduce it on a fairly consistent basis - notice the lag between the mouse clicks and responses, I think this lag has something to do with the issue - the project loads at 2:56 in the video: https://youtu.be/N3PeI2CjQyI?t=176

  • Posted 9 December 2021, 3:41 pm EST

    Hi Glen,

    Thanks for the video link. But this is private video, we can’t access. You can make it as public, so that we can access.

    Or you can also use DropBox to share files.

    Regard,

    Nitin.

  • Posted 10 December 2021, 10:20 pm EST

    Made the video public: https://youtu.be/N3PeI2CjQyI?t=176

  • Posted 12 December 2021, 5:01 pm EST

    Hi,

    Thanks for the video reference.

    We aren’t facing this error at our end. So we have forwarded this video to the development team and will get in touch with you when we get update from the devs.

    Regards,

    Nitin

  • Posted 16 December 2021, 11:46 pm EST

    faced same issue but its got resolved automatically in next update.

  • Posted 17 January 2022, 11:04 pm EST

    I have created a support ticket regarding this issue - it has not gone away for me.

  • Posted 18 January 2022, 6:48 pm EST

    Please note - if I run the builds (Debug or Release) outside the Visual Studio IDE, this error does not manifest itself - it only shows up when running the builds from within the Visual Studio IDE (both 2019 and 2022).

  • Posted 18 January 2022, 7:08 pm EST - Updated 3 October 2022, 11:31 pm EST

    Nitin, Attached is a screenshot from the output window as requested.

  • Posted 19 January 2022, 8:32 pm EST

    Hello,

    Thank you for sharing the attachment.

    We are actively discussing it with the devs to find out the cause of the issue. However, it would be very difficult to provide any resolution for this issue until the issue reproduces at our end.

    Regards,

    Nitin

  • Posted 19 January 2022, 9:11 pm EST - Updated 3 October 2022, 11:31 pm EST

    I understand and appreciate your position - but understand mine - I have paid for a license and the product isn’t currently working in my environment.

    If it is not the product, but my environment, I am just looking for any suggestions as to what the cause could be.

    I have attached a stack trace from the DispatcherUnhandledExceptionEventArgs captured by the applications DispatcherUnhandledException event.

  • Posted 19 January 2022, 9:43 pm EST

    Hi Glenn,

    We understand your situation and we really regret the inconvenience caused to you.

    Could you please share the following information with us?

    Are you using multiple monitors? If yes then please share how they are arranged. For example, one in left and other in right or one on top and other on bottom etc.

    What is the resolution of each monitor you are using?

    Best Regards,

    Nitin

  • Posted 19 January 2022, 11:45 pm EST

    My setup is as follows:

    • The computer is a laptop
    • It is connected to a docking station, which runs through a KVM connecting a keyboard, mouse and screen.
    • I am using a single screen at the recommended display resolution of 1920x1080 with the scale and layout set at 100%

    Keep in mind, the error still occurs when I disconnect everything (including the internet), power down, restart and run Visual Studio on the laptop.

    I have attached a demo written in VB.NET - again, the timing is extremely random when in the VS IDE (but it will always occur) and does not occur when running the code outside of VS. 2022-01-20-WPFDemo.zip

  • Posted 25 January 2022, 8:15 pm EST

    Added this to my application - this solution at least prevents the application from crashing.

    
    Private Sub Application_DispatcherUnhandledException(sender As Object, e As DispatcherUnhandledExceptionEventArgs) Handles Me.DispatcherUnhandledException
    	If e.Exception.Message = "This Visual is not connected to a PresentationSource." Then
    		e.Handled = True
            End If
    End Sub
    
    
  • Posted 26 January 2022, 11:09 pm EST

    Hello,

    Sorry for the delay in response.

    The issue has been replicated at our end while running the application on a Virtual Machine. We have escalated it to the devs and will get back to you once we get any update from them.

    Best Regards,

    Nitin

  • Posted 22 February 2022, 9:09 pm EST

    Hi,

    We are sorry to inform you that this behavior isn’t occurring due to our component. It would happen when Visual Studio is slow or lagging. It’s more like issue is in Wpf Framework where it doesn’t giving expected behavior according to the performance of the machine.

    Best Regards,

    Nitin

  • Posted 28 February 2022, 8:54 am EST

    Interesting… it is the only control that I have come across that causes this error.

    • So, is this then even considered an issue?
    • If so, does Grape City communicate this issue MS?
    • If not, is it assumed that a computer’s minimum resources for application’s using this control must be defined prior to its distribution?

    Alternatively, handling the exception as follows works… so, for now, I guess it is the solution to use:

    Private Sub Application_DispatcherUnhandledException(sender As Object, e As DispatcherUnhandledExceptionEventArgs) Handles Me.DispatcherUnhandledException
    	If e.Exception.Message = "This Visual is not connected to a PresentationSource." Then
    		e.Handled = True
            End If
    End Sub
    
  • Posted 1 March 2022, 7:50 pm EST

    Hello glen,

    As per the devs, it has the same system requirements as WPF platform.

    For .Net Framework: https://docs.microsoft.com/en-us/dotnet/framework/get-started/system-requirements

    For .Net 6: https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net60

    And there are some similar issues in MS support forums, most cases are hard to reproduce and MS closed them on low priority.

    Our development team is working on this to overcome this behavior and we will let you know once they update on this.

    Regards,

    Nitin

  • Posted 31 March 2022, 10:12 pm EST

    Hi,

    We are happy to inform you that this issue has been fixed with the latest build 2022v1.

    So, we would request you to upgrade to the latest build using ComponentOne control panel. Just in case if you don’t have ComponentOne Control Panel, you can download it from https://www.grapecity.com/componentone/download.

    Best Regards,

    Nitin

  • Posted 2 April 2022, 6:53 pm EST

    I can confirm this error is no longer occurring with the latest build 2022v1 - thanks.

  • Posted 3 April 2022, 11:59 pm EST

    Hi,

    Thanks for your acknowledgement.

    Regards,

    Nitin.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels