我正在尝试c ++ / WRL,但我没有做基础知识,主要是调用异步函数并获取结果,例如如何获取由以下代码返回的IStorageFile:
HString path;
path.Set(L"C:\\somepath\\somefile.txt");
// Get the Activation Factory
ComPtr<IActivationFactory> pStorageFileActivationFactory;
hr = GetActivationFactory(HStringReference(RuntimeClass_Windows_Storage_StorageFile).Get(), &pStorageFileActivationFactory);
if (FAILED(hr))
{
return PrintError(__LINE__, hr);
}
ComPtr<IStorageFileStatics> pStorageFileStatics;
hr = pStorageFileActivationFactory.As(&pStorageFileStatics);
__FIAsyncOperation_1_Windows__CStorage__CStorageFile* filePathStorage;
hr = pStorageFileStatics->GetFileFromPathAsync(path.Get(), &filePathStorage);
如何执行 filePathStorage IAsyncOperation对象?我怎么能用c ++ / WRL做到这一点?