This project is read-only.

AccessViolationException

Jan 14, 2011 at 4:06 PM

I referenced NKinect.dll in my WPF project.

I'm receiving an AccessViolationException from KinectFactory.GetKinect();

AccessViolationException "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

   at SetNUIMotorLED(Void* , Byte )   at NKinect.CLKinect.SetLed(LedColor color) in d:\documents\visual studio 2010\projects\nkinect\nkinect\clkinect.h:line 134   at NKinect.CLKinect..ctor() in d:\documents\visual studio 2010\projects\nkinect\nkinect\clkinect.h:line 39   at NKinect.KinectFactory.GetKinect() in d:\documents\visual studio 2010\projects\nkinect\nkinect\kinectfactory.h:line 19   at KinectMap.CameraWindow2.InitCamera() in C:\code\KinectMap\KinectMap\CameraWindow2.xaml.cs:line 66   at KinectMap.CameraWindow2..ctor() in C:\code\KinectMap\KinectMap\CameraWindow2.xaml.cs:line 38   at KinectMap.MainWindow.MainWindow_KeyUp(Object sender, KeyEventArgs e) in C:\code\KinectMap\KinectMap\MainWindow.xaml.cs:line 47   at System.Windows.Input.KeyEventArgs.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(DependencyObject sender, RoutedEventArgs args)   at System.Windows.UIElement.RaiseTrustedEvent(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.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, Int32 numArgs)   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)   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.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled)   at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(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(Window window)   at System.Windows.Application.Run()   at KinectMap.App.Main() in C:\code\KinectMap\KinectMap\obj\x86\Debug\App.g.cs:line 0   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)   at System.Threading.ThreadHelper.ThreadStart()

Jan 14, 2011 at 4:08 PM
What version of CL NUI are you using? NKinect is only supported on v1121.
Jan 14, 2011 at 4:20 PM

That's the one I'm using. I pulled it out of the source code in the codeplex repo

Jan 14, 2011 at 4:21 PM

I should say that's the DLL I've got in by bin folder. I did install the newest CLNUI driver & SDK. Does that need to be uninstalled?

Jan 14, 2011 at 4:46 PM
Yep. You've got to compile using 1121 and have 1121 installed. Think I left the link in one of the other threads.