locked
How do you create a new GUID in C++ in WinRT? RRS feed

Answers

  • You can use CoCreateGuid API to general GUID. Please follow these codes.

    	GUID gdn;
    	CoCreateGuid(&gdn);
    	Guid gd(gdn);
    	String^ guid=gd.ToString();

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Monday, September 17, 2012 3:10 AM
    Tuesday, September 11, 2012 2:10 AM
  • Platform::Guid     A 128-bit nonnumeric value (a GUID) in the Platform namespace.

    See Guid::Guid Constructor

    • Marked as answer by Jesse Jiang Monday, September 17, 2012 3:10 AM
    Monday, September 10, 2012 4:30 PM

All replies

  • Platform::Guid     A 128-bit nonnumeric value (a GUID) in the Platform namespace.

    See Guid::Guid Constructor

    • Marked as answer by Jesse Jiang Monday, September 17, 2012 3:10 AM
    Monday, September 10, 2012 4:30 PM
  • You can use CoCreateGuid API to general GUID. Please follow these codes.

    	GUID gdn;
    	CoCreateGuid(&gdn);
    	Guid gd(gdn);
    	String^ guid=gd.ToString();

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Monday, September 17, 2012 3:10 AM
    Tuesday, September 11, 2012 2:10 AM