我試圖在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