locked
ABI + WRL how to get IStorageFolder.Path ?

    Question

  • I want to get the Path property of IStorageFolder of InstalledLocation

    HString hstrAppData; hstrAppData.Set(RuntimeClass_Windows_ApplicationModel_Package); ComPtr<IActivationFactory> pActivationFactory; HRESULT hr = GetActivationFactory(hstrAppData.Get(), &pActivationFactory); ComPtr<IPackageStatics> pPackage; hr = pActivationFactory.As(&pPackage); if (FAILED(hr)) ::Microsoft::WRL::Details::RaiseException(hr); ComPtr<IPackage> pCurrent; hr = pPackage->get_Current(&pCurrent); if (FAILED(hr)) ::Microsoft::WRL::Details::RaiseException(hr); ComPtr<IStorageFolder> pStorageFolder; hr = pCurrent->get_InstalledLocation(&pStorageFolder); if (FAILED(hr)) ::Microsoft::WRL::Details::RaiseException(hr); pStorageFolder-> ???

    Am I right ?  And what's next?

    Thanks



    • Edited by Raptor K Tuesday, April 10, 2012 5:01 PM
    Tuesday, April 10, 2012 4:56 PM

Answers

All replies