小编Joe*_*Joe的帖子

c ++/cx中的storagefile :: ReadAsync异常?

我一直在尝试使用c ++/cx StorageFile::ReadAsync()来读取商店应用程序中的文件,但它始终返回无效的params异常,无论什么

// "file" are returned from FileOpenPicker
IRandomAccessStream^ reader = create_task(file->OpenAsync(FileAccessMode::Read)).get();
if (reader->CanRead)
{
    BitmapImage^ b = ref new BitmapImage();
    const int count = 1000000;
    Streams::Buffer^ bb = ref new Streams::Buffer(count);
    create_task(reader->ReadAsync(bb, 1, Streams::InputStreamOptions::None)).get();
}
Run Code Online (Sandbox Code Playgroud)

我已打开所有清单功能,并为声明添加了"文件打开选取器"+"文件类型关联".有任何想法吗 ?谢谢!

ps:我找到的大多数解决方案都是针对C#,但代码结构类似......

c++ windows-8 c++-cx windows-store-apps

3
推荐指数
1
解决办法
2338
查看次数

标签 统计

c++ ×1

c++-cx ×1

windows-8 ×1

windows-store-apps ×1