IAsyncAction WindowsStoreImpl::GetPrice()

in WindowsStoreDLL/WindowsStoreImpl.cpp [144:162]


IAsyncAction WindowsStoreImpl::GetPrice(WindowsStoreCallback callback, void* userData)
{
    // return control to caller
    co_await winrt::resume_background();

    // now execute the async code
    StoreProductResult result = co_await m_storeContext.GetStoreProductForCurrentAppAsync();
    {
        if (result.ExtendedError().value == S_OK)
        {
            callback(S_OK, result.Product().Price().FormattedPrice().c_str(), userData);
        }
        else
        {
            callback(result.ExtendedError().value, L"Unknown", userData);
        }
    }
    co_return;
}