in WindowsStoreDLL/WindowsStore.cpp [23:50]
WindowsStoreErrorType store_initialize(WindowsStorePtr* storePtr, HWND window, WindowsStoreCallback licenseChangedCallback, void* userData)
{
*storePtr = nullptr;
// Check if app is running inside of an App Package
if (!isRunningInsideAppPackage())
{
return WINRT_APP_PACKAGE_ERROR;
}
// Initialize the Windows Runtime.
winrt::init_apartment(winrt::apartment_type::single_threaded);
// attempt to initialize the Windows Store WinRT Implementation
WindowsStoreImpl* store = new WindowsStoreImpl();
WindowsStoreErrorType result = store->Initialize(window, licenseChangedCallback, userData);
if (result != WINRT_NO_ERROR)
{
delete store;
*storePtr = nullptr;
}
else
{
*storePtr = (WindowsStorePtr)store;
}
return result;
}