我正在尝试使用Share Charm在Windows 8 Metro C++应用程序中共享图像.为此,我需要先将图像加载到StorageFile ^.我认为它应该看起来像:
create_task(imageFile->GetFileFromPathAsync("Textures/title.png")).then([this](StorageFile^ storageFile)
{
imageFile = storageFile;
});
Run Code Online (Sandbox Code Playgroud)
其中imageFile在头文件中定义
Windows::Storage::StorageFile^ imageFile;
Run Code Online (Sandbox Code Playgroud)
这个实际的代码会抛出这个例子
An invalid parameter was passed to a function that considers invalid parameters fatal.
Run Code Online (Sandbox Code Playgroud)
这似乎非常简单,但是关于在Metro中共享的文档很少,并且唯一的Microsoft示例显示了如何使用FilePicker进行共享.
如果有人知道如何正确地做到这一点,将非常感激.