I am trying to drag an image from WPF application to UWP application but getting this error "invalid formatetc structure (exception from hresult: 0x80040064 (dv_e_formatetc)) in GetStorageItemsAsync method"
public async void OnFileDrop(object sender, DragEventArgs e) {
List<StorageFile> dropFiles = new List<StorageFile>();
if (e.DataView.Contains(StandardDataFormats.StorageItems))
{
var items = await e.DataView.GetStorageItemsAsync();
var isShow2GBMessage = false;
var isShowEXEerrorMessage = false;
if (items.Count > 0)
{
foreach (var appFile in items.OfType<StorageFile>())
{
BasicProperties filesize = await appFile.GetBasicPropertiesAsync();
var fileSize = filesize.Size;
CheckAndAddFiles(dropFiles, ref isShow2GBMessage, ref isShowEXEerrorMessage, appFile, fileSize);
}
}
UploadFiles(dropFiles);
}
}
When I drag the image it is getting copied into a folder but how do I get the path address using DragEventArgs?
User contributions licensed under CC BY-SA 3.0