0

What API is available for generating a UUID in UWP application using C++?

The function UuidCreate is available only for desktop Apps as in :

https://msdn.microsoft.com/en-us/library/windows/desktop/aa379205(v=vs.85).aspx

Thx in advance.

isaac.hazan
  • 3,772
  • 6
  • 46
  • 76

1 Answers1

1

If GUID is sutable alternative for you, you can try Guid.NewGuid().

EDIT: Actually, Guid structure is not part of WinRT, so you can't access it via C++. But since you're using C++ , why do you look for UWP specific way to generate UUID? I haven't touched C++ for some while, but I belive you can use any of existing C++ implementation of UUID generator, for example Boost UUID library or CoCreateGuid function.

Andrei Ashikhmin
  • 2,401
  • 2
  • 20
  • 34
  • 1
    [They're the same thing](http://stackoverflow.com/questions/246930/is-there-any-difference-between-a-guid-and-a-uuid). – vcsjones Mar 17 '16 at 15:12
  • Thx. What header file is this available in? My UWP does not recognize it when i try to use it. Thx. – isaac.hazan Mar 17 '16 at 15:18
  • Also that page does not provide an example for the C++ language which i am suing. Doesn't that hint that it is not available in C++? Thx. – isaac.hazan Mar 17 '16 at 15:28
  • Forgive me, I didn't know Guid structure might not be available using C++. Did you tried [CoCreateGuid](https://msdn.microsoft.com/en-us/library/ms688568%28VS.85%29.aspx) method? – Andrei Ashikhmin Mar 17 '16 at 15:40
  • Okay seems like indeed CoCreateGuuid is available in UWP. If you update your answer with this, i'll accept the answer(already upvoted). Thx. – isaac.hazan Mar 19 '16 at 19:12