Программы на C++. Форум разработчиков
Anonymous
Запуск C ++/Winrt Quick-Start, но вызывает исключение в VS2022
Сообщение
Anonymous » 22 июн 2025, 19:41
Ниже приводится программа быстрого начала Winrt: < /p>
Код: Выделить всё
// WinRT.cpp
// Single source file runs
#include
#include
#include
#pragma comment(lib, "windowsapp.lib")
using namespace winrt;
using namespace Windows::Foundation;
using namespace Windows::Web::Syndication;
int main()
{
winrt::init_apartment();
Uri rssFeedUri{ L"https://blogs.windows.com/feed" };
SyndicationClient syndicationClient;
SyndicationFeed syndicationFeed = syndicationClient.RetrieveFeedAsync(rssFeedUri).get();
for (const SyndicationItem syndicationItem : syndicationFeed.Items())
{
winrt::hstring titleAsHstring = syndicationItem.Title().Text();
std::wcout
Исключение < /p>
Исключение, выброшенное по адресу 0x00007ffd9c78a839 в Winrt.exe: Microsoft C ++ Exception: winrt :: hResult_error at memoriefore 0x0000f009cffa00. /> < /blockquote>
Что пошло не так? Заранее спасибо.
Подробнее здесь: [url]https://stackoverflow.com/questions/73351032/running-c-winrt-quick-start-but-cause-exception-in-vs2022[/url]
1750610460
Anonymous
Ниже приводится программа быстрого начала Winrt: < /p> [code] // WinRT.cpp // Single source file runs #include #include #include #pragma comment(lib, "windowsapp.lib") using namespace winrt; using namespace Windows::Foundation; using namespace Windows::Web::Syndication; int main() { winrt::init_apartment(); Uri rssFeedUri{ L"https://blogs.windows.com/feed" }; SyndicationClient syndicationClient; SyndicationFeed syndicationFeed = syndicationClient.RetrieveFeedAsync(rssFeedUri).get(); for (const SyndicationItem syndicationItem : syndicationFeed.Items()) { winrt::hstring titleAsHstring = syndicationItem.Title().Text(); std::wcout Исключение < /p> Исключение, выброшенное по адресу 0x00007ffd9c78a839 в Winrt.exe: Microsoft C ++ Exception: winrt :: hResult_error at memoriefore 0x0000f009cffa00. /> < /blockquote> Что пошло не так? Заранее спасибо. Подробнее здесь: [url]https://stackoverflow.com/questions/73351032/running-c-winrt-quick-start-but-cause-exception-in-vs2022[/url]