What is the exception that this code is throwing and how to fix it?
the code is:
include "pch.h"
using namespace winrt;
using namespace Windows;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::Foundation::Numerics;
using namespace Windows::UI;
using namespace Windows::UI::Core;
using namespace Windows::UI::Composition;
struct App : IFrameworkView
{
void Initialize(CoreApplicationView const& applicationView)
{
}
void Load(hstring const&)
{
}
void Uninitialize()
{
}
void Run()
{
CoreWindow window = CoreWindow::GetForCurrentThread();
window.Activate();
CoreDispatcher dispatcher = window.Dispatcher();
dispatcher.ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
}
void SetWindow(CoreWindow const & window)
{
}
};
struct AppSource : IFrameworkViewSource
{
virtual IFrameworkView CreateView()
{
return App();
}
};
int __stdcall wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
{
CoreApplication::Run(AppSource());
}
It shows the window for a few seconds and then stops, throwing this window:
How can i fix this?