locked
GetFilesAsync(Search::CommonFileQuery::OrderByName)抛出InvalidArgumentException异常 RRS feed

  • 问题

  • 我自己用C++写的运行时组件,可当我调用folder->GetFilesAsync(Search::CommonFileQuery::OrderByName)时抛出如下异常:
    First-chance exception at 0x7711277C in TaskHost.exe: Microsoft C++ exception: Platform::InvalidArgumentException ^ at memory location 0x00F2EBC4. HRESULT:0x80070057

    具体代码如下:
            Windows::Storage::StorageFolder^ folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
            create_task(folder->GetFilesAsync(Search::CommonFileQuery::OrderByName))        
                    .then ([this](IVectorView<StorageFile^>^ files)
            {        
                    for ( unsigned int i = 0 ; i < files->Size; i++)
                    {

                            Windows::Storage::StorageFile^ file = files->GetAt(i);
                            Platform::String^ path = file->Path;
                    }
            });

    在windows8上可以,在windows phone8上就抛出异常,将OrderByName换成DefaultQuery就没有问题。
    哪位大大知道如何解决该问题
    2013年5月8日 7:24