0

I'm having trouble getting the "file save picker" contract working in Windows Phone 10 for my Universal Windows App. I've added both "File Save Picker" and "Cached File Updater" declarations to the app manifest.

It works fine for me on a full Windows 10 computer (tested Mail and Mobile Word).

When I try it on a phone running WP10, I get a native exception A heap has been corrupted (parameters: 0x77344270) with error code 0xc0000374. No part of the stacktrace leads into my app.

My TargetFileRequested listener:

    private async void FileSavePickerUI_TargetFileRequested(
        FileSavePickerUI sender,
        TargetFileRequestedEventArgs args)
    {
        var deferral = args.Request.GetDeferral();
        var filePath = GetSelectedFilePath();

        args.Request.TargetFile = await StorageFile.GetFileFromPathAsync(filePath);

        CachedFileUpdater.SetUpdateInformation(
            args.Request.TargetFile,
            CachedFileListener.CreateContentId(contentId, destination),
            ReadActivationMode.NotNeeded,
            WriteActivationMode.AfterWrite,
            CachedFileOptions.None);

        deferral.Complete();
    }

I'm overriding OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs args), but it never gets called (app crashes before here).

Again, it only crashes in WP10. Win10 works fine.

Note: sometimes it doesn't appear to crash, but the updater method is still never called.

I have also tried this sample here: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/FilePickerContracts

And I get similar results in that OnCachedFileUpdaterActivated is only ever called on desktop not phone.

FUR10N
  • 750
  • 6
  • 18
  • Is is possible OnFileSavePickerActivated gets hit? – Jackie Feb 03 '16 at 06:07
  • @Jackie yes, that gets called at the beginning. I didn't show that part but that's where I register 'FileSavePickerUI_TargetFileRequested'. I'm able to show the UI to chose a destination fine, but when the other app is finished saving, I never get the callback. – FUR10N Feb 03 '16 at 12:36
  • I have the same Problem -> http://stackoverflow.com/questions/41595862/uwp-filesavepicker-contract-file-processing/ Do you found any solution for this? – andy Jan 21 '17 at 13:38
  • @andy nope. Probably have to wait for something from MS – FUR10N Jan 23 '17 at 14:27

0 Answers0