System.Runtime.InteropServices.COMException when make chart

Found a possible bug in LightningChart? Report it here.

Moderator: Arction_LasseP

bool001
Posts: 9
Joined: Wed Apr 04, 2018 3:06 am

System.Runtime.InteropServices.COMException when make chart

Post by bool001 » Mon Jul 30, 2018 12:32 pm

Hi, I test my application on a laptop, when create a chart the UI is STUCK. And I get a exception with my bug reportor, below it is:

OS: Windows
Windows: 6.3.17134.0
Date: 2018-07-30T11:52:55.2269912Z

System.Runtime.InteropServices.COMException: UCEERR_RENDERTHREADFAILURE (HRESULT:0x88980406)
在 System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
在 System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet)
在 System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)
在 System.Windows.Interop.HwndTarget.OnWindowPosChanging(IntPtr lParam)
在 System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

And below is my laptop information:
CPU: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz 2.50 GHz
RAM: 8.00 GB (7.48 GB Available)

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: System.Runtime.InteropServices.COMException when make ch

Post by ArctionPasi » Mon Jul 30, 2018 5:35 pm

Hi,

most likely reason for this, is to forget to Control.Invoke (WinForms) or Dispatcher.Invoke (WPF) when updating data from background thread to chart. For correct usage, please see ExampleThreadMultiChannel example in the demo applications.
LightningChart Support Team, PT

bool001
Posts: 9
Joined: Wed Apr 04, 2018 3:06 am

Re: System.Runtime.InteropServices.COMException when make ch

Post by bool001 » Thu Aug 02, 2018 3:15 am

ArctionPasi wrote:Hi,

most likely reason for this, is to forget to Control.Invoke (WinForms) or Dispatcher.Invoke (WPF) when updating data from background thread to chart. For correct usage, please see ExampleThreadMultiChannel example in the demo applications.
Hi, thank you.
I provide some details:
1. My program use the LightingChart WPF lib.
2. There is no problem that run my program on other computers.
3. When run LightingChart official demo on this laptop, also occur same problem that it get stuck when create charts.
4. LightingChart Winform lib is OK, but WPF libs(bindable, Semi-bindable, non-bindable) all occur the problem.

Below is the detail of my laptop:
Manufacturer: LENOVO,
DeviceModel: 20J6A012CD,
TotalPhysicalMemoryInGB: 7GB,
OSVersion: Microsoft Windows NT 6.2.9200.0,
Is64BitOS: True,
ProcessorCount: 4,
CpuInfo: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz,
VideoControllerInfo: Intel(R) HD Graphics 630

I'm very grade to upload the demonstrate video if you leave me a mail address.

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: System.Runtime.InteropServices.COMException when make ch

Post by ArctionPasi » Mon Aug 06, 2018 7:03 am

Hello,

so it seems to be a computer-specific problem. First, make sure all Windows Updates have been installed, and Intel drivers updated.

If the problem doesn't solve, please send us email on support [at} arction.com, and we'll give more detailed support there :)
LightningChart Support Team, PT

bool001
Posts: 9
Joined: Wed Apr 04, 2018 3:06 am

Re: System.Runtime.InteropServices.COMException when make ch

Post by bool001 » Sat Aug 11, 2018 4:31 am

My laptop has two video card drivers. Once disabled one, the chart is available now. I don't why. I look forward to get more detail about this problem. thank you!

warnerwanton
Posts: 1
Joined: Tue Jan 29, 2019 11:11 am

Re: System.Runtime.InteropServices.COMException when make ch

Post by warnerwanton » Tue Jan 29, 2019 11:13 am

When an error occurs during object creation, a COMException (defined in System.Runtime.InteropServices) is thrown. The UnknownWrapper class is a helper class designed to be exposed to COM as a VARIANT. When you use the late-binding mechanism, you can avoid this behavior if you pass the parameters as UnKnownWrapper to methods that have parameters of type IUnKnown. The UnKnownWrapper constructor initializes a new instance of the UnknownWrapper class with the object that will be wrapped.

symbolick
Posts: 49
Joined: Thu May 16, 2013 8:24 pm

Re: System.Runtime.InteropServices.COMException when make ch

Post by symbolick » Wed May 08, 2019 8:34 pm

Our software has been distributed to a large community using LightningChartUltimate WPF for the performance increases it provides. There are a number of users that crash with this exception on load while using a laptop with multiple video cards. We have to have one on one correspondence with users to correct this. The fixes we have found is that on windows 7 we have them disable the Intel integrated graphics card such that only their more powerful GPU is being used. When this is done the application executes as expected. Another work around we have found in the windows 10 environment is to go to graphics setting and manually add our application to the high performance option, which I believe does the same thing except at the application level rather than the whole of the OS.

It is a point of frustration for the end users and trainers as they are spending time trouble shooting technical issues rather than using the software as expected.

Has there been any research into how this can be fixed in code on our end or in an update from Arction?

Thanks,
Aaron

Arction_LasseP
Posts: 105
Joined: Wed Mar 27, 2019 1:05 pm

Re: System.Runtime.InteropServices.COMException when make ch

Post by Arction_LasseP » Tue May 14, 2019 11:23 am

Hello,

We haven't got many reports about this issue but we investigated this some time ago. However, we weren't able to reproduce it as this is not an error in LightningChart but in WPF in general. There is a bit old but still informative blog by Microsoft about these kinds of errors: https://blogs.msdn.microsoft.com/dsui_t ... -failures/
It seems that fixing this depends on the case, usually on the machine or the graphics card(s) used. In some cases, just updating the drivers can solve the issue.

If there is an issue with WPF application using LightningChart that cannot be solved by for example updating the drivers, we suggest sending an e-mail to support[at]arction.com with more details about the specific case and perhaps a way to reproduce the error. Currently we don't have a single solution on our end that can prevent all these kinds of errors from happening.

joshua
Posts: 1
Joined: Tue Dec 15, 2020 10:12 am

Re: System.Runtime.InteropServices.COMException when make chart

Post by joshua » Tue Dec 15, 2020 10:25 am

Hi!

I am very happy to find this thread. Unfortunately right after I figured out the solution:
First of all the situation:
We use for programming desktop PC and Laptop with 1 gpu. After deploying our software on a customer laptop, we had to deal with unwanted behavior. Every time we tried to open the WPF view of our software, it kept freezing. No error or whatsoever. After installing IDE and program code on that specific machine, we got the error message in the title of this thread.
After too long time and just the moment before buying a new laptop for our customer, we figured out that the machine uses 2 gpu's:
Intel HD Graphics 4600 and NVIDIA GeForce GTX 960M.
Then after quickly changing the performance option (like symbolick posted and in this thread: https://www.howtogeek.com/351522/how-to ... indows-10/), everything worked like a charm...

I really want to emphasize the trickiness of this error, due to the complication of when it happens usually (at customer site with unknown hardware).

Anyways really glad there is already this thread. If you want more information, I am happy to provide it.

Best
Joshua