0

I am trying to wrap my head around Component Object Model; but everywhere I look, I see UUIDs.

What bothers me is how are these UUIDs generated, and how do you make sure that your component won't have the same UUID as another one.

Surely with a large enough pool of UUIDs, there might be a collision.

Do COM UUIDs ever collide? If they do, how do you deal with it? Do you just do a project string replace your old UUIDs to the first uuid that pops to your head?

Sorry this question is a bit clumsy but it's a bit difficult to formulate it, and I have not seen any similar questions yet, and I just wanted to get it out of my head.

Dmytro
  • 5,068
  • 4
  • 39
  • 50
  • 1
    http://stackoverflow.com/questions/1155008/how-unique-is-uuid – Thilo Apr 21 '16 at 01:52
  • Yeah that post talks more about how unique it is, but the summary is that it can collide. It doesn't seem to talk much about consequences of collisions, and handling collisions. Or what are the common practices in generating UUIDs in typical COM projects. – Dmytro Apr 21 '16 at 01:53
  • Where does it say that it can (realistically) collide? – Thilo Apr 21 '16 at 01:56
  • @Thilo I'm a believer in Murphy's law. Besides I can make a UUID that conflicts with another COM object on purpose, can't I? – Dmytro Apr 21 '16 at 01:56
  • 1
    Yes, you can make conflicts on purpose. As for how to generate them, Microsoft has a uuidgen tool: https://msdn.microsoft.com/en-us/library/windows/desktop/aa373928%28v=vs.85%29.aspx – Thilo Apr 21 '16 at 01:57
  • 1
    There is a lot of litterature on guids. Check the 3 posts here: https://blogs.msdn.microsoft.com/ericlippert/tag/guids/ – Simon Mourier Apr 21 '16 at 07:39
  • @SimonMourier I heard Microsoft blogs a lot but dang that's a good blog. – Dmytro Apr 21 '16 at 13:06

0 Answers0