question

Victor-Chen avatar image
0 Votes"
Victor-Chen asked ·

Desktop Bridge app got an error code when request update: 0x769e4192

The following is the code I refer to here and here. btnRequestUpdate_Click can be executed and can correctly ask me if I need to download the update, when I click "OK", I will get an error: "0x769e4192 (located in appName.exe) exception: Microsoft C++ exception: winrt::hresult_error, located in memory location 0x06a8f0a0"

I tried to use RequestDownloadStorePackageUpdatesAsync, but got the same error.

So how can I solve this problem? thanks a lot.

 [ComImport]
 [Guid("3E68D4BD-7135-4D10-8018-9FB6D9F33FA1")]
 [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
 public interface IInitializeWithWindow
 {
     void Initialize(IntPtr hwnd);
 }
    
 private async void btnRequestUpdate_Click(object sender, RoutedEventArgs e)
 {
     var context = StoreContext.GetDefault();
     IInitializeWithWindow initWindow = (IInitializeWithWindow)(object)context;
     initWindow.Initialize(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle);
    
     IReadOnlyList<StorePackageUpdate> storePackageUpdates =
         await context.GetAppAndOptionalStorePackageUpdatesAsync();
     if (storePackageUpdates.Count == 0) return;
     IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> downloadOperation =
         context.RequestDownloadAndInstallStorePackageUpdatesAsync(storePackageUpdates);
     downloadOperation.Progress = (asyncInfo, progress) =>
     {
         Consolo.WriteLine($"progress: {progress}");
     };
 }
windows-uwpwindows-desktop-bridge
· 19
10 |1000 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.

May I know where the error comes? Is it returned by the RequestDownloadAndInstallStorePackageUpdatesAsync method or it throws the exception when you run that line of code?

0 Votes 0 · ·

@RoyLi-MSFT Thanks for your reply. The error does not appear here. In fact, all the codes are completely executed. When I click OK in UI dialog, the error appears in a C++ class library. However, I cannot know which line of code reports the error, because I have no source code

0 Votes 0 · ·

Ok, this is confusing. When the code is completely executed, there should be an alert for the user permission to download and install the update. Then when you click the OK button and the error shows, right? Please point me out if I misunderstand it.

0 Votes 0 · ·
Show more comments

0 Answers