Approved
Last Updated: 28 Oct 2019 13:31 by ADMIN
Czeshirecat
Created on: 16 Oct 2019 09:55
Category: WebCam
Type: Bug Report
1
RadWebCam: System.NullReferenceException: 'Object reference not set to an instance of an object.' after webCam.Start()
01.Exception
02. 
03.System.NullReferenceException: 'Object reference not set to an instance of an object.'
04. 
05.Stack trace.
06. 
07."   at MediaFoundation.Misc.BitmapInfoHeader.CopyFrom(BitmapInfoHeader bmi)"
08. 
09.CallStack
10. 
11.     MediaFoundation.dll!MediaFoundation.Misc.BitmapInfoHeader.CopyFrom(MediaFoundation.Misc.BitmapInfoHeader bmi)    Unknown
12.     MediaFoundation.dll!MediaFoundation.Misc.BMMarshaler.MarshalNativeToManaged(System.IntPtr pNativeData)    Unknown
13.     [Native to Managed Transition]   
14.     [Managed to Native Transition]   
15.     Telerik.Windows.MediaFoundation.dll!Telerik.Windows.MediaFoundation.WebCamPresenter.TakeSnapshot()    Unknown
16.     Telerik.WinControls.RadWebCam.dll!Telerik.WinControls.UI.RadWebCam.TakeSnapshot()    Unknown
17.     Telerik.WinControls.RadWebCam.dll!Telerik.WinControls.UI.RadWebCamElement.TakeSnapshot_Click(object sender, System.EventArgs e)    Unknown
18.     Telerik.WinControls.dll!Telerik.WinControls.RadElement.OnClick(System.EventArgs e)    Unknown
19.     Telerik.WinControls.UI.dll!Telerik.WinControls.UI.RadButtonItem.OnClick(System.EventArgs e)    Unknown
20.     Telerik.WinControls.UI.dll!Telerik.WinControls.UI.RadButtonElement.OnClick(System.EventArgs e)    Unknown
21.     Telerik.WinControls.dll!Telerik.WinControls.RadElement.DoClick(System.EventArgs e)    Unknown
22.     Telerik.WinControls.dll!Telerik.WinControls.RadElement.RaiseBubbleEvent(Telerik.WinControls.RadElement sender, Telerik.WinControls.RoutedEventArgs args)    Unknown
23.     Telerik.WinControls.dll!Telerik.WinControls.RadItem.RaiseBubbleEvent(Telerik.WinControls.RadElement sender, Telerik.WinControls.RoutedEventArgs args)    Unknown
24.     Telerik.WinControls.dll!Telerik.WinControls.RadElement.RaiseRoutedEvent(Telerik.WinControls.RadElement sender, Telerik.WinControls.RoutedEventArgs args)    Unknown
25.     Telerik.WinControls.dll!Telerik.WinControls.RadElement.DoMouseUp(System.Windows.Forms.MouseEventArgs e)    Unknown
26.     Telerik.WinControls.dll!Telerik.WinControls.ComponentInputBehavior.OnMouseUp(System.Windows.Forms.MouseEventArgs e)    Unknown
27.     Telerik.WinControls.dll!Telerik.WinControls.RadControl.OnMouseUp(System.Windows.Forms.MouseEventArgs e)    Unknown
28.     System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks)    Unknown
29.     System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)    Unknown
30.     System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m)    Unknown
31.     Telerik.WinControls.dll!Telerik.WinControls.RadControl.WndProc(ref System.Windows.Forms.Message m)    Unknown
32.     System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m)    Unknown
33.     System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)    Unknown
34.     System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam)    Unknown
35.     [Native to Managed Transition]   
36.     [Managed to Native Transition]   
37.     System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData)    Unknown
38.     System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context)    Unknown
39.     System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context)    Unknown
40.     System.Windows.Forms.dll!System.Windows.Forms.Application.RunDialog(System.Windows.Forms.Form form)    Unknown
41.     System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner)    Unknown
42.>    pulse.move.factories.dll!pulse.move.factories.views.ViewFactory.ShowWebCam(System.Windows.Forms.Form owner) Line 952    C#

The exception bubbles up to the ViewFactory.ShowWebCam() method, but it doesn't get trapped by that method's try/catch or in your OnWebCamError event.

To reproduce (a bit random)

Im using a logitech HD C270, usb cam

There's often a period of initialization where the cam shows a white or black screen. Sometimes, pressing the control's capture button during this period causes the exception.

I reproduced it in the telerik Quick Start Framework, web cam app. The following code window is the stack trace of when it happened.

I understand that this is within Media Foundation code, and I'm guessing the capture is asynchronous, but is there any way that your control can catch the error as I know my users will be onto the support department when it happens?

Or is there any way to disable your embedded buttons until an image actually appears? I've tried trapping some paint events within the control but failed.

There's also no indication of what's happening during the initialization period, which has taken 10-20 secs occasionally, so it's very tempting to press those buttons :)

001.See the end of this message for details on invoking
002.just-in-time (JIT) debugging instead of this dialog box.
003. 
004.************** Exception Text **************
005.System.NullReferenceException: Object reference not set to an instance of an object.
006.   at MediaFoundation.Misc.BitmapInfoHeader.CopyFrom(BitmapInfoHeader bmi)
007.   at MediaFoundation.Misc.BMMarshaler.MarshalNativeToManaged(IntPtr pNativeData)
008.   at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToManaged(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome)
009.   at MediaFoundation.EVR.IMFVideoDisplayControl.GetCurrentImage(BitmapInfoHeader pBih, IntPtr& pDib, Int32& pcbDib, Int64& pTimeStamp)
010.   at Telerik.Windows.MediaFoundation.WebCamPresenter.TakeSnapshot()
011.   at Telerik.WinControls.UI.RadWebCam.TakeSnapshot()
012.   at Telerik.WinControls.UI.RadWebCamElement.TakeSnapshot_Click(Object sender, EventArgs e)
013.   at Telerik.WinControls.RadElement.OnClick(EventArgs e)
014.   at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
015.   at Telerik.WinControls.UI.RadButtonElement.OnClick(EventArgs e)
016.   at Telerik.WinControls.RadElement.DoClick(EventArgs e)
017.   at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
018.   at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
019.   at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
020.   at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
021.   at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
022.   at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
023.   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
024.   at System.Windows.Forms.Control.WndProc(Message& m)
025.   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
026.   at Telerik.WinControls.RadControl.WndProc(Message& m)
027.   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
028.   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
029.   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
030. 
031. 
032.************** Loaded Assemblies **************
033.mscorlib
034.    Assembly Version: 4.0.0.0
035.    Win32 Version: 4.7.3468.0 built by: NET472REL1LAST_C
036.    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
037.----------------------------------------
038.TelerikExamples
039.    Assembly Version: 2019.3.917.40
040.    Win32 Version: 2019.3.917.40
041.    CodeBase: file:///C:/Program%20Files%20(x86)/Progress/Telerik%20UI%20for%20WinForms%20R3%202019/Examples/QuickStart/Bin/TelerikExamples.exe
042.----------------------------------------
043.System.Windows.Forms
044.    Assembly Version: 4.0.0.0
045.    Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
046.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
047.----------------------------------------
048.System
049.    Assembly Version: 4.0.0.0
050.    Win32 Version: 4.7.3451.0 built by: NET472REL1LAST_C
051.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
052.----------------------------------------
053.System.Drawing
054.    Assembly Version: 4.0.0.0
055.    Win32 Version: 4.7.3190.0 built by: NET472REL1LAST_C
056.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
057.----------------------------------------
058.QuickStart
059.    Assembly Version: 2019.3.917.40
060.    Win32 Version: 2019.3.917.40
061.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/QuickStart/v4.0_2019.3.917.40__5bb2a467cbec794e/QuickStart.dll
062.----------------------------------------
063.Telerik.WinControls.UI
064.    Assembly Version: 2019.3.917.40
065.    Win32 Version: 2019.3.917.40
066.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.UI/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.UI.dll
067.----------------------------------------
068.System.Core
069.    Assembly Version: 4.0.0.0
070.    Win32 Version: 4.7.3468.0 built by: NET472REL1LAST_C
071.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
072.----------------------------------------
073.Telerik.WinControls
074.    Assembly Version: 2019.3.917.40
075.    Win32 Version: 2019.3.917.40
076.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.dll
077.----------------------------------------
078.TelerikCommon
079.    Assembly Version: 2019.3.917.40
080.    Win32 Version: 2019.3.917.40
081.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/TelerikCommon/v4.0_2019.3.917.40__5bb2a467cbec794e/TelerikCommon.dll
082.----------------------------------------
083.System.Xml
084.    Assembly Version: 4.0.0.0
085.    Win32 Version: 4.7.3190.0 built by: NET472REL1LAST_C
086.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
087.----------------------------------------
088.Telerik.WinControls.Themes.TelerikMetro
089.    Assembly Version: 2019.3.917.40
090.    Win32 Version: 2019.3.917.40
091.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.TelerikMetro/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.TelerikMetro.dll
092.----------------------------------------
093.System.Configuration
094.    Assembly Version: 4.0.0.0
095.    Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
096.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
097.----------------------------------------
098.Microsoft.GeneratedCode
099.    Assembly Version: 1.0.0.0
100.    Win32 Version: 4.7.3190.0 built by: NET472REL1LAST_C
101.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
102.----------------------------------------
103.Telerik.WinControls.Themes.Fluent
104.    Assembly Version: 2019.3.917.40
105.    Win32 Version: 2019.3.917.40
106.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Fluent/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Fluent.dll
107.----------------------------------------
108.Telerik.WinControls.Themes.FluentDark
109.    Assembly Version: 2019.3.917.40
110.    Win32 Version: 2019.3.917.40
111.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.FluentDark/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.FluentDark.dll
112.----------------------------------------
113.RadControlSpy
114.    Assembly Version: 2019.3.917.40
115.    Win32 Version: 2019.3.917.40
116.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/RadControlSpy/v4.0_2019.3.917.40__5bb2a467cbec794e/RadControlSpy.dll
117.----------------------------------------
118.Telerik.WinControls.Themes.Aqua
119.    Assembly Version: 2019.3.917.40
120.    Win32 Version: 2019.3.917.40
121.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Aqua/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Aqua.dll
122.----------------------------------------
123.Telerik.WinControls.Themes.Breeze
124.    Assembly Version: 2019.3.917.40
125.    Win32 Version: 2019.3.917.40
126.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Breeze/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Breeze.dll
127.----------------------------------------
128.Telerik.WinControls.Themes.Desert
129.    Assembly Version: 2019.3.917.40
130.    Win32 Version: 2019.3.917.40
131.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Desert/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Desert.dll
132.----------------------------------------
133.Telerik.WinControls.Themes.HighContrastBlack
134.    Assembly Version: 2019.3.917.40
135.    Win32 Version: 2019.3.917.40
136.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.HighContrastBlack/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.HighContrastBlack.dll
137.----------------------------------------
138.Telerik.WinControls.Themes.Office2007Black
139.    Assembly Version: 2019.3.917.40
140.    Win32 Version: 2019.3.917.40
141.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2007Black/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2007Black.dll
142.----------------------------------------
143.Telerik.WinControls.Themes.Office2007Silver
144.    Assembly Version: 2019.3.917.40
145.    Win32 Version: 2019.3.917.40
146.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2007Silver/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2007Silver.dll
147.----------------------------------------
148.Telerik.WinControls.Themes.Office2010Black
149.    Assembly Version: 2019.3.917.40
150.    Win32 Version: 2019.3.917.40
151.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2010Black/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2010Black.dll
152.----------------------------------------
153.Telerik.WinControls.Themes.Office2010Silver
154.    Assembly Version: 2019.3.917.40
155.    Win32 Version: 2019.3.917.40
156.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2010Silver/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2010Silver.dll
157.----------------------------------------
158.Telerik.WinControls.Themes.Office2010Blue
159.    Assembly Version: 2019.3.917.40
160.    Win32 Version: 2019.3.917.40
161.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2010Blue/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2010Blue.dll
162.----------------------------------------
163.Telerik.WinControls.Themes.Office2013Dark
164.    Assembly Version: 2019.3.917.40
165.    Win32 Version: 2019.3.917.40
166.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2013Dark/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2013Dark.dll
167.----------------------------------------
168.Telerik.WinControls.Themes.Office2013Light
169.    Assembly Version: 2019.3.917.40
170.    Win32 Version: 2019.3.917.40
171.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2013Light/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2013Light.dll
172.----------------------------------------
173.Telerik.WinControls.Themes.TelerikMetroBlue
174.    Assembly Version: 2019.3.917.40
175.    Win32 Version: 2019.3.917.40
176.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.TelerikMetroBlue/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.TelerikMetroBlue.dll
177.----------------------------------------
178.Telerik.WinControls.Themes.TelerikMetroTouch
179.    Assembly Version: 2019.3.917.40
180.    Win32 Version: 2019.3.917.40
181.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.TelerikMetroTouch/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.TelerikMetroTouch.dll
182.----------------------------------------
183.Telerik.WinControls.Themes.VisualStudio2012Dark
184.    Assembly Version: 2019.3.917.40
185.    Win32 Version: 2019.3.917.40
186.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.VisualStudio2012Dark/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.VisualStudio2012Dark.dll
187.----------------------------------------
188.Telerik.WinControls.Themes.VisualStudio2012Light
189.    Assembly Version: 2019.3.917.40
190.    Win32 Version: 2019.3.917.40
191.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.VisualStudio2012Light/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.VisualStudio2012Light.dll
192.----------------------------------------
193.Telerik.WinControls.Themes.Windows7
194.    Assembly Version: 2019.3.917.40
195.    Win32 Version: 2019.3.917.40
196.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Windows7/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Windows7.dll
197.----------------------------------------
198.Telerik.WinControls.Themes.Windows8
199.    Assembly Version: 2019.3.917.40
200.    Win32 Version: 2019.3.917.40
201.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Windows8/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Windows8.dll
202.----------------------------------------
203.Telerik.WinControls.Themes.Material
204.    Assembly Version: 2019.3.917.40
205.    Win32 Version: 2019.3.917.40
206.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Material/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Material.dll
207.----------------------------------------
208.Telerik.WinControls.Themes.MaterialPink
209.    Assembly Version: 2019.3.917.40
210.    Win32 Version: 2019.3.917.40
211.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.MaterialPink/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.MaterialPink.dll
212.----------------------------------------
213.Telerik.WinControls.Themes.MaterialTeal
214.    Assembly Version: 2019.3.917.40
215.    Win32 Version: 2019.3.917.40
216.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.MaterialTeal/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.MaterialTeal.dll
217.----------------------------------------
218.Telerik.WinControls.Themes.MaterialBlueGrey
219.    Assembly Version: 2019.3.917.40
220.    Win32 Version: 2019.3.917.40
221.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.MaterialBlueGrey/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.MaterialBlueGrey.dll
222.----------------------------------------
223.Telerik.WinControls.Themes.Crystal
224.    Assembly Version: 2019.3.917.40
225.    Win32 Version: 2019.3.917.40
226.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Crystal/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Crystal.dll
227.----------------------------------------
228.Telerik.WinControls.Themes.CrystalDark
229.    Assembly Version: 2019.3.917.40
230.    Win32 Version: 2019.3.917.40
231.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.CrystalDark/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.CrystalDark.dll
232.----------------------------------------
233.System.Data
234.    Assembly Version: 4.0.0.0
235.    Win32 Version: 4.7.3260.0 built by: NET472REL1LAST_C
236.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
237.----------------------------------------
238.Telerik.WinControls.RadWebCam
239.    Assembly Version: 2019.3.917.40
240.    Win32 Version: 2019.3.917.40
241.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.RadWebCam/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.RadWebCam.dll
242.----------------------------------------
243.Telerik.Windows.MediaFoundation
244.    Assembly Version: 2019.3.910.40
245.    Win32 Version: 2019.3.910.40
246.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.Windows.MediaFoundation/v4.0_2019.3.910.40__5803cfa389c90ce7/Telerik.Windows.MediaFoundation.dll
247.----------------------------------------
248.Telerik.WinControls.ChartView
249.    Assembly Version: 2019.3.917.40
250.    Win32 Version: 2019.3.917.40
251.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.ChartView/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.ChartView.dll
252.----------------------------------------
253.MediaFoundation
254.    Assembly Version: 3.1.0.32450
255.    Win32 Version: 3.1.0.0
256.    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/MediaFoundation/v4.0_3.1.0.32450__36fa660e1d6ebf8d/MediaFoundation.dll
257.----------------------------------------
258. 
259.************** JIT Debugging **************
260.To enable just-in-time (JIT) debugging, the .config file for this
261.application or computer (machine.config) must have the
262.jitDebugging value set in the system.windows.forms section.
263.The application must also be compiled with debugging
264.enabled.
265. 
266.For example:
267. 
268.<configuration>
269.    <system.windows.forms jitDebugging="true" />
270.</configuration>
271. 
272.When JIT debugging is enabled, any unhandled exception
273.will be sent to the JIT debugger registered on the computer
274.rather than be handled by this dialog box.

9 comments
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 28 Oct 2019 13:31

Hello, Claire,        

The provided sample project and video are greatly appreciated. I have eliminated all try-catch usages in order to track more easily what happens in the project and where the error occurs. Indeed, in some cases, RadWeCam throws a ThreadException:

To handle this scenario, the camera buttons shouldn't be enabled while it is not streaming video. Probably, a new Initialized event is good to be introduced to handle this scenario better. We will take care of it when addressing this case. Meanwhile, in order to avoid such cases, the possible solution that I can suggest is to disable the buttons in RadWebCam and enable it once the camera is initialized. You can use a timer and after one second is elapsed after starting the camera, enable the buttons.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Czeshirecat
Posted on: 24 Oct 2019 11:37

I've split the code from my solution and have included it in the testwebcam.rar.

A video of this project is in video.rar

Attached Files:
Czeshirecat
Posted on: 24 Oct 2019 09:10

Hi again Dess

Press the TakeSnapshotButton when the background of the webcam control hasn't yet got an image. Sometimes the image appears instantly so you won't be able to click it, sometimes it takes a few seconds to appear.

When you click the button sometimes theres an exception, sometimes not.

I believe the exception is a thread error and bubbles up to Application_ThreadException, if it's been assigned.

I've fudged a fix by adding a local/temporary application thread exception handler to my webcam form as follows:

    private void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
    {
      #region Code
      try
      {

        // Throw exception to program.cs level exception handler if its not a mediafoundation error

       if (!e.Exception.Source.ToUpperInvariant().Contains("MEDIAFOUNDATION"))
          throw e.Exception;

        // Log the error anyway
        Log4Net.Log.Error(e.Exception);

        ViewFactory.ShowError(this, GuiResources.An_error_has_been_thrown_by_a_net_MediaFoundation_thread);
        DialogResult = DialogResult.Abort;
      }
      catch (Exception err)
      {
        Log4Net.Log.Error(err);
        throw;
      }
      #endregion
    }// function

I hope this helps :)

ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 23 Oct 2019 11:16
Hello, Claire,      

Following the provided video, it is not very clear what causes the error on your end. That is why I have prepared a basic example with a RadWebCam which is not started automatically. The attached gif file illustrates the behavior on my end.

Could you please specify the exact steps how to reproduce the problem? Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Czeshirecat
Posted on: 18 Oct 2019 08:21
Czeshirecat
Posted on: 18 Oct 2019 07:48

Please see the following video as I don't think you understand what I mean. It shows a couple of successes then a failure.

http://www.mediafire.com/file/92p7s8s5q30ts6j/2019-10-18_08-33-24.mp4/file

The attached png shows where I'll eventually embed the control once it's working solidly.

 

https://www.mediafire.com/view/e6wuye4qftopspg/Untitled.png/file

Attached Files:
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 17 Oct 2019 14:04

Hello, Claire,      

If the camera is not started automatically, but after calling its Start method when the form is loaded, it wouldn't be a problem to move RadWebCam.Start method in the Shown event of the form or after a button click is handled after users' interaction. Thus, you are not supposed to encounter any errors.

I hope this information helps. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Czeshirecat
Posted on: 17 Oct 2019 07:45

In response to Dess's comment.

This is in our member editor form where photos can be loaded from file or webcam if they own one. So the start button may be pressed "some time" after the editor form is shown eg when a new member joins the gym.

The control is being used on an independent form for testing purposes and behaves similarly to your firstlooks demo

ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 16 Oct 2019 14:06

Hello, Claire,      

By default, RadWebCam starts automatically after running the application. Its AutoStart property is set to true. It is not necessary to call its Start method explicitly. 

However, if you decide to set its AutoStart property to false, make sure that you call the RadWebCam.Start method after the form is loaded and the camera is initialized. I suppose that you call the Start method in the form's constructor which is too early for calling this method. This error can't be considered as appropriate UI. That is why I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to either to leave the camera to start automatically or call the Start method in the form's Load event.

I hope this information helps. If you need any further assistance please don't hesitate to contact me.

 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.