Surface Simulator抛出“指定的强制转换无效”。例外 [英] Surface Simulator throws "Specified cast is not valid." exception

查看:142
本文介绍了Surface Simulator抛出“指定的强制转换无效”。例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


我们正在几台PC上开发Surface应用程序(Win7 x64,VS2008和VS2010)。由于在这些PC上运行WPF4触摸应用程序,Surface Simulator不再起作用。


它抛出"指定的强制转换无效"。启动期间的异常。


堆栈跟踪是:


  在Microsoft.Surface.Simulator.NativeMethods.CoCreateInstance(Guid rclsid,Object pUnkOuter,CLSCTX dwClsContext,Guid riid)

  在Microsoft.Surface.Simulator.InputCommunication.Implementation.SimulatorRemoteApiClient.StaticCreateServerProxy(String serverGuid)

  在Microsoft.Surface.Simulator.InputCommunication.Implementation.SimulatorRemoteApiClient..ctor()

  在Microsoft.Surface.Simulator.InputCommunication.SurfaceInputController..ctor(Boolean runSimulatorFilterGraph)

  在Microsoft.Surface.Simulator.App.SimulatorWindowContentRendered(Object sender,EventArgs e)

  在System.Windows.PresentationSource.FireContentRendered(Object arg)

   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)

  在System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调,Object args,Boolean isSingleParameter,Delegate catchHandler)

  在System.Windows.Threading.DispatcherOperation.InvokeImpl()

  在System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(对象状态)

   at System.Threading.ExecutionContext.runTryCode(Object userData)

  在System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码,CleanupCode backoutCode,Object userData)

  在System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback回调,对象状态)

  在System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback回调,对象状态)

  在System.Windows.Threading.DispatcherOperation.Invoke()

  在System.Windows.Threading.Dispatcher.ProcessQueue()

  在System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean& handling)

  在MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean& processed)

  在MS.Win32.HwndSubclass.DispatcherCallbackOperation(对象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)

  在System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调,Object args,Boolean isSingleParameter,Delegate catchHandler)

   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority,TimeSpan timeout,Delegate方法,Object args,Boolean isSingleParameter)

   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority,Delegate method,Object arg)

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

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

  在System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame框架)

  在System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame框架)

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

  在System.Windows.Application.RunDispatcher(对象忽略)

  在System.Windows.Application.RunInternal(窗口窗口)

  在System.Windows.Application.Run(窗口窗口)

  在System.Windows.Application.Run()

  在Microsoft.Surface.Simulator.SimulatorMain.Main()


这个问题有一个已知的解决方案吗?


谢谢,


Helge; - )=)

解决方案

x64机器上不支持表面模拟器。你在32位机器上也有这个问题吗?


谢谢!


-Luis。


 


Hi!

We're developping Surface applications on several PCs (Win7 x64, VS2008 and VS2010). Since running WPF4 touch apps on these PCs the Surface Simulator doesn't work anymore.

It throws an "Specified cast is not valid." exception during start-up.

The stack trace is:

   at Microsoft.Surface.Simulator.NativeMethods.CoCreateInstance(Guid rclsid, Object pUnkOuter, CLSCTX dwClsContext, Guid riid)
   at Microsoft.Surface.Simulator.InputCommunication.Implementation.SimulatorRemoteApiClient.StaticCreateServerProxy(String serverGuid)
   at Microsoft.Surface.Simulator.InputCommunication.Implementation.SimulatorRemoteApiClient..ctor()
   at Microsoft.Surface.Simulator.InputCommunication.SurfaceInputController..ctor(Boolean runSimulatorFilterGraph)
   at Microsoft.Surface.Simulator.App.SimulatorWindowContentRendered(Object sender, EventArgs e)
   at System.Windows.PresentationSource.FireContentRendered(Object arg)
   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.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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.WrappedInvoke(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 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(Window window)
   at System.Windows.Application.Run()
   at Microsoft.Surface.Simulator.SimulatorMain.Main()

Is there a known solution to this problem?

Thanks,

Helge ;-)=)

解决方案

The surface simulator is not supported on x64 machines. Do you have this issue on 32 bit machines as well?

Thanks!

-Luis.

 


这篇关于Surface Simulator抛出“指定的强制转换无效”。例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆