Код: Выделить всё
HString path;
path.Set(L"C:\\somepath\\somefile.txt");
// Get the Activation Factory
ComPtr pStorageFileActivationFactory;
hr = GetActivationFactory(HStringReference(RuntimeClass_Windows_Storage_StorageFile).Get(), &pStorageFileActivationFactory);
if (FAILED(hr))
{
return PrintError(__LINE__, hr);
}
ComPtr pStorageFileStatics;
hr = pStorageFileActivationFactory.As(&pStorageFileStatics);
__FIAsyncOperation_1_Windows__CStorage__CStorageFile* filePathStorage;
hr = pStorageFileStatics->GetFileFromPathAsync(path.Get(), &filePathStorage);
Подробнее здесь: https://stackoverflow.com/questions/252 ... t-on-c-wrl
Мобильная версия