Asked by:
Having issues with getting GetFilesAsync() and/or causing breakpoint using BitmapImage

Question
-
All,
I have been working with the below code using C++. I have tried and looked at every reference possible but I am lost.
The code below is to open a folder location and load all the jpg files so I can display them in flipview.
It is not completed because I can't get pass the bitmap break point issue. During debugging I am able to identify that fileQuery has all (6) the jpg file information.
create_task(folderPicker->PickSingleFolderAsync()).then([this](StorageFolder^ folder)
{
if (folder != nullptr)
{
auto fileTypeFilter = ref new Vector<Platform::String^>();
fileTypeFilter->Append(".jpg");
auto queryOptions = ref new QueryOptions(CommonFileQuery::OrderByDate,fileTypeFilter);
auto fileQuery = folder->CreateFileQueryWithOptions(queryOptions);
create_task(fileQuery->GetFilesAsync()).then([this](IVectorView<StorageFile^>^ files)
{
BitmapImage^ bitmapImage = ref new BitmapImage();
for each (StorageFile^ file in files)
{
bitmapImage->SetSourceAsync(files);
}
});
Thanks,
Grim
- Edited by A.B.P.Lambert Tuesday, January 14, 2014 8:48 PM
Tuesday, January 14, 2014 8:45 PM
All replies
-
What error do you get and where?
Can you provide a minimal sample project which demonstrates the issue?
--Rob
Tuesday, January 14, 2014 10:18 PMModerator -
Rob,
How do I get the demo project to you?
Grim
Wednesday, January 15, 2014 2:21 PM -
I definitely think I am having a issue with the below line.
create_task(fileQuery->GetFilesAsync()).then([this](IVectorView<StorageFile^>^ files)
But I am unable to fine any reference for the Get the above.
Grim
Wednesday, January 15, 2014 7:20 PM -
Please share a link to your repro project on your SkyDrive.
Your second code snippet looks fine.
Wednesday, January 15, 2014 10:14 PMModerator