Reputation: 33036
It is super easy to go from Platform::Guid^
to Platform::String^
with the ToString()
method. See the documentation for more details.
But how do we convert from Platform::String^
to Platform::Guid^
?
Edit:
Both CLSIDFromString
and IIDFromString
will do. Please refer to the accepted answer as an example. Also please #include <wrl\wrappers\corewrappers.h>
.
Upvotes: 0
Views: 1336
Reputation: 941465
Just call in the help from the IIDFromString() function. Sample code:
Platform::String^ example("{6DDAD7B6-F8C5-42D9-B4EB-59FE94A4EA5F}");
GUID rawguid;
HRESULT hr = IIDFromString(example->Data(), &rawguid);
if (SUCCEEDED(hr)) {
Platform::Guid guid(rawguid);
// etc..
}
Upvotes: 5