Issues with RequestPurchaseAsync in MFC C++ Application
Ming Yu
0
Reputation points
An app has been published in the Partner Center, and an addon submission has been created. This is the addon subscription overview.
In the application, there is an MFC project and a Windows Runtime Component (Universal Windows) project, as depicted below.
The Class1 is declared as follows:
namespace WindowsRuntimeComponent1
{
public ref class Class1 sealed
{
public:
Class1();
int Purchase();
};
}
The method Purchase() is implemented as:
int Class1::Purchase()
{
Windows::Services::Store::StoreContext^ storeContext;
storeContext = StoreContext::GetDefault();
create_task(storeContext->RequestPurchaseAsync("myAddonStoreID")).then([](StorePurchaseResult^ result)
{
// .......
}, task_continuation_context::get_current_winrt_context());
}
The program crashes at the line:
create_task(storeContext->RequestPurchaseAsync("myAddonStoreID")).then([](StorePurchaseResult^ result)
What mistakes could be causing this issue? Thank you very much.
Sign in to answer