在x64 ScatterView运行时异常 [英] ScatterView runtime exception on x64

查看:270
本文介绍了在x64 ScatterView运行时异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所描述的同样的问题<一href="http://stackoverflow.com/questions/16187718/surface-runtime-exception-on-windows-8">here.

I have the same issue as described here.

我们已经开发出使用旧微软Surface 2.0 SDK几个应用程序。 的应用程序构建为值为anycpu 和那些完全正常工作无论是在32位和64位模式下运行。在这些应用程序中的一个我用的是 ScatterView

We have developed several applications using the old Microsoft Surface 2.0 SDK. The applications are built as AnyCPU and those work perfectly fine running both in 32 bit and 64 bit mode. In one of these application I use a ScatterView.

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
        <s:ScatterView x:Name="timeline">
            <Rectangle></Rectangle>
        </s:ScatterView>
    </Grid>
</Window>

但是,如果我尝试添加一个新的 ScatterView 一个新的空白窗口我得到这个错误:

However if I try to add a new ScatterView in a new blank Window I get this error:

{"The type initializer for 'Microsoft.Surface.Core.InteractiveSurface' threw an exception."}

System.TypeInitializationException was unhandled
HResult=-2146233036
Message=The type initializer for 'Microsoft.Surface.Presentation.Input.InteractiveSurface'  threw an exception.
Source=Microsoft.Surface.Presentation
TypeName=Microsoft.Surface.Presentation.Input.InteractiveSurface

如果我强迫应用程序在 32位执行运行完美。然而,应用程序是pretty的内存密集型的,所以我想在 64位运行它。

If I force the application to run in 32 bit it runs perfectly. However the application is pretty memory intensive so I would like to run it in 64 bit as well.

我的问题是,:为什么在我的当前应用程序的ScatterView完美的64位运行,但增加一个额外的ScatterView就此申请或立即产生brend新的应用程序崩溃。不幸的是在previous问题给出的答案有一个死链接。

My question is: How come the ScatterView in my current application runs perfectly in 64 bit, but adding an additional ScatterView to this application or creating a brend new application crashes immediately. Unfortunately the answer given in the previous questions has a dead link.

推荐答案

当然,48小时后寻找我的找到了解决我自己的问题。

Of course after 48 hours of searching I found a solution to my own question.

当您在 ScatterView 中,调用了功能 GetItemOrientation 在<$ C添加项目$ C> Microsoft.Surface。presentation.Controls.ScatterCanvas 。该功能决定了 ScatterViewItem 旋转。当运行在 64位应用程序此方法失败并抛出一个异常,可能是通过调用本地方法造成的,以确定它应该在其上运行的SUR40的方向

When you add an item in the ScatterView, a call is made to the function GetItemOrientation in Microsoft.Surface.Presentation.Controls.ScatterCanvas. This function determines the rotation of the ScatterViewItem. When running your application in 64bit this method fails and throws an exception, probably caused by a call to a native method to determine the orientation of the SUR40 on which it is supposed to run.

解决方法: 您可以通过设置方向财产上的 ScatterViewItem GetItemOrientation code>自己或通过设置 ScatterViewItem.CanRotate = FALSE

Solution: You can disable the function call to GetItemOrientation by setting the Orientation property on the ScatterViewItem yourself or by setting ScatterViewItem.CanRotate = false.

这篇关于在x64 ScatterView运行时异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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