我试图在Windows 8 Metro C++应用程序中使用共享魅力共享图像。为此,我需要首先将图像加载到StorageFile ^。我认为它应该是这样的:将图像从内容加载到StorageFile ^在Metro C++中
create_task(imageFile->GetFileFromPathAsync("Textures/title.png")).then([this](StorageFile^ storageFile)
{
imageFile = storageFile;
});
其中imageFile
在头文件中定义
Windows::Storage::StorageFile^ imageFile;
这实际代码将抛出此exeption
An invalid parameter was passed to a function that considers invalid parameters fatal.
这似乎是很琐碎,但关于在Metro中共享的文档很少,唯一的Microsoft示例显示了如何使用FilePicker进行共享。
非常感谢,如果有人知道如何正确地做到这一点。
谢谢!解决方案看起来非常微不足道! – 2012-07-24 23:46:19