Problem whlie Drag and Drop in c++/winrt

Vivek Rao 20 Reputation points
2023-08-31T08:11:52.35+00:00

I have made a WinUI3 application using c++. I have one filepicker and one drag and drop region in my application which picks and drags images respectively. While I am picking the images it is able to pick the file count the number of images and then I have a button , on click of that button it is getting stored in the local file. But when I am dragging and dropping the images it is able to count the number of images dragged and dropped but when I am clicking the button to save it throws an exception in output: Exception thrown at 0x00007FF9A0EACF19 in App2.exe: Microsoft C++ exception: winrt::hresult_invalid_argument at memory location 0x0000008DB3D9BF28.

so I try to apply try and catch block for it and i got the error message as : Error in SaveLocalFileAsync: The specified token ({244C833C-9A76-49C7-BC0A-EC2FFFF40A3A}) is not associated with an item in the access list.onecore\com\combase\dcomrem\preventrundownbias.cpp(1310)\combase.dll!00007FF9A1EBBF8C: (caller: 00007FF9A1EBBDB9) LogHr(2) tid(295c) 80070005 Access is denied.

But it is working fine in the case of filepicker only showing this exception while i dragging and dropping the images.

Any pointer on this, would be appreciated.

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
737 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,596 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
778 questions
{count} votes