question

HenryZhou-6708 avatar image
0 Votes"
HenryZhou-6708 asked HenryZhou-6708 commented

XAML Island for Win32 app API GetFileFromApplicationUriAsync not working

In the sample code of NativeXamlIslands, I add the following code to test the StorageFile::GetFileFromApplicationUriAsync API of c++/winrt in MainUserControl.cpp file, but it doesn't work:

static const Uri s_jsonFileUri{ L"ms-appx:///Images/Activities.json" };

 IAsyncAction GetActivitiesAsync()
 {
     auto jsonText{ co_await FileIO::ReadTextAsync(co_await StorageFile::GetFileFromApplicationUriAsync(s_jsonFileUri)) };
     printf("hello.\n");
 }

 MainUserControl::MainUserControl()
 {  
     GetActivitiesAsync();
     InitializeComponent();
 }

Please let me know what the reason behind? Thanks a lot!

c++
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@HenryZhou-6708

According to the issue, it is more related to XAML Islands. I suggest you could post the issue to Github for better help.


0 Votes 0 ·

OK, thank you!

0 Votes 0 ·

0 Answers