- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试从 Windows Phone 8.1 C++ 运行时组件访问 CoreWindow。该组件需要对 CoreWindow 触发的一些事件使用react。我有以下代码。
IAsyncAction^ MyClass::RegisterCoreWindowVisibilityChanged()
{
return CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(CoreDispatcherPriority::High,
ref new DispatchedHandler(
[this]
{
auto eventHandler = ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &MyClass::OnCoreWindowVisibilityChanged);
Window::Current->CoreWindow->VisibilityChanged += eventHandler;
}
));
}
当使用该组件的应用程序是一个通用应用程序时,这工作正常,但在 silverlight 应用程序中失败并出现访问冲突异常。
0xC0000005: Access violation reading location 0x00000000.
显然 Windows::Current
在 silverlight 应用程序中返回 null。有没有一种方法可以让它在 silverlight 和 Windows 商店应用程序中工作?
最佳答案
该对象仅在通用应用程序中可用(如 documented )。
您需要对编译进行条件化或考虑切换到适用于桌面和手机的通用应用程序。
关于c# - 从 Windows Phone 8.1 运行时组件访问 CoreWindow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30640712/
嘿嘿, 我遇到了一个问题。我正在完成为完成游戏而必须做的所有最后测试,但现在我遇到了一个问题。每当我在竖屏模式下初始化游戏时,游戏都会切换为横屏模式,但 Window.Current.CoreWind
我正在使用 C# 开发一个简单的通用 Windows 应用程序。我有一个 RichEditBox,并且在使用 Control+I 组合键时发现了奇怪的行为,由于某种原因,它会插入一个 Tab(这是预期
我正在使用 C# 开发一个简单的通用 Windows 应用程序。我有一个 RichEditBox,并且在使用 Control+I 组合键时发现了奇怪的行为,由于某种原因,它会插入一个 Tab(这是预期
我正在尝试获取 CoreDispatcher在 Windows Phone 8 上的 C++ 中,以便我可以将工作项提交给 UI 线程 Dispatcher,以便我可以更新 UI 线程上的 UI 元素
CoreApplicationView有什么区别, CoreWindow , 和 ApplicationView ? 我可以看到每个应用程序都有不同的属性等,所以我不是在问“我应该使用哪个来获取 ab
我目前正在开发一个 Win8 项目,该项目使用 C# 和 XAML 作为应用程序的前端,使用带有 DirectX 的 C++ 作为图形密集型部分。因为它主要以实时图形和输入为中心,所以我决定使用为 C
这个简短的 MSDN 文档说 CoreWindow 有 ICoreWindowInterop 获取 CoreWindow 的句柄 HWND。但我找不到有关如何获取它的引用资料 (C#)。请帮忙。 ht
我正在尝试从 Windows Phone 8.1 C++ 运行时组件访问 CoreWindow。该组件需要对 CoreWindow 触发的一些事件使用react。我有以下代码。 IAsyncActio
当我在 UWP 应用程序中有一个文本框时(对我来说)有奇怪的行为。 在 Windows 10 中创建一个通用的空白应用 UWP 应用。 使用以下代码将文本框添加到默认网格: 构建并运行应用程序。 在
在 Windows 应用商店应用中,我们需要一个在设备方向改变时发生的事件。我发现了两个事件,有人知道它们之间有什么区别吗? Windows.UI.Core.CoreWindow.GetForCurr
我正在尝试通过 WH_CALLWNDPROC 上的 Hook 获取特定窗口的 Pointer Win32 消息, WH_CALLWNDPROCRET和 WH_GETMESSAGE . 我使用 SetW
我是一名优秀的程序员,十分优秀!