(cpp)cx中将string转换成GUID
· 阅读需 1 分钟
#include <windows.h>
using namespace Windows::ApplicationModel::Store;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
Platform::String^ transactionId = "{xxxxx}"; //从微软的内购中获取的订单号字符串
GUID guid;
HRESULT hr = IIDFromString(transactionId->Data(), &guid);
if (SUCCEEDED(hr)) {
Platform::Guid guid_transactionId(guid);
auto fuillAsync = CurrentApp::ReportConsumableFulfillmentAsync(productId, guid_transactionId); //完成订单
}