I’m brand new to C++/CLI and I am attempting to convert a native C++ GUID to my C++/CLI Guid^. When attempting my conversion:
BlockInfo^ blockInfo = gcnew BlockInfo();
blockInfo->BlockFilterGuid = ba.BlockAllFilter.subLayerKey;
…I recieve the following error:
error C2440: ‘=’ : cannot convert from ‘GUID’ to ‘System::Guid ^’
I understand that the root source of my problem is that am trying to convert from an unmanaged to a managed type, but I’m not proficent enough in either C++ or C++/CLI to know how to solve the issue.
A native
GUIDis defined:You need to allocate a
System::Guidand construct it properly using the data in the nativeGUID.