2

私は 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 でこれを行うにはどうすればよいですか?

4

0 に答える 0