首页 > 解决方案 > IoT Core 的 C++/WinRT 控制台应用程序卡在初始屏幕上

问题描述

这只是模板中的开箱即用(如从此处指示),并通过执行远程机器调试会话推送到(虚拟机)模拟设备。

为什么它卡在启动画面上?有人遇到同样的情况吗?我错过了什么吗?

当我运行它时,它部署得很好,给出了这个调试输出(没什么可说的,我不认为):

'ConsoleCppWinRt3.exe' (Win32): Loaded 'U:\Users\DefaultAccount\AppxLayouts\cc60f819-ef47-4858-b213-8af8c3669919VS.Debug_Win32.nm1\ConsoleCppWinRt3.exe'. Symbols loaded.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'C:\Windows\System32\kernel32legacy.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'U:\Programs\WindowsApps\Microsoft.VCLibs.140.00.Debug_14.0.26428.1_x86__8wekyb3d8bbwe\vcruntime140d_app.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'U:\Users\DefaultAccount\AppxLayouts\cc60f819-ef47-4858-b213-8af8c3669919VS.Debug_Win32.nm1\ucrtbased.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Cannot find or open the PDB file.
'ConsoleCppWinRt3.exe' (Win32): Loaded 'C:\Windows\System32\procthreadexthost.dll'. Cannot find or open the PDB file.
The thread 0xd38 has exited with code 0 (0x0).

编辑 如果我暂停调试器,它在控制台代码中。但是闪屏还是碍事什么的。例如,在这段代码中,调试器在getchar()调用中:

int main()
{
    wprintf(L"Hello IoT");
    getchar();
}

但在这段代码中:

int main()
{
    wprintf(L"Hello IoT");
    Sleep(10000);
}

...它在Sleep通话中,但在 10 秒后它关闭导致 Visual Studio 声明:

无法激活 Windows 商店应用程序 [...]。myapp.exe 进程已启动,但激活请求失败并出现错误“应用程序未启动”。

我不应该调用一些东西来关闭启动屏幕或一些明显的东西,是吗?

标签: c++windows-10-iot-core

解决方案


推荐阅读