唯一的GUID问题 [英] Unique GUID Problem..

查看:126
本文介绍了唯一的GUID问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解到GUID在PC上应该是唯一的.这就是为什么我们在VS中使用GUID Generator的原因.

让我们假设我们创建一个带有某些界面的COM文件,该界面具有特定的GUID,这在我们的PC上是唯一的.

现在,当我将此COM文件传输到其他PC时,它可能在注册表中包含相同的GUID.

那会很麻烦.

我认为我的概念在某些地方是错误的.需要帮助...吗?

I have learned that GUIDs should be unique on a PC. thats why we use GUID Generator in VS.

Lets suppose that we create a COM file with some interface with particular GUID which is unique on our PC.

Now when i transfer this COM file to some other PC, it might contains same GUID in the registry.

Then it will be a trouble.

I think i am wrong somewhere with my concepts. need help...?

推荐答案

我不确定如何响应,除非指出原因是字符串太长是Microsoft正是以此方式设计的,因此生成的每个GUID都是唯一的.在该行业的10多年中,我从未听说过COM组件具有与另一个组件相同的GUID. Visual Studio提供了一个GUID生成器. MS建议,如果您只是弥补它们而不是使用它们,可能会面临一些小风险,但是如果以正确的方式生成GUID,就不会有发生这种情况的真正风险.尤其是现在几乎没有人使用COM了:P
I''m not sure how to respond to this, except to point out that the reason it''s such a long string, is that Microsoft designed it precisely this way so that each GUID that is generated, will be unique. I''ve never, in over 10 years in the industry, heard of a COM component ever finding it has the same GUID as another. There''s a GUID generator provided with Visual Studio. MS suggests if you just make them up instead of using that, you may be at some small risk, but if you generate your GUIDs the right way, there''s no real risk of that ever happening. Especially now that almost no-one uses COM anymore :P


唯一ID是32位十六进制字符串,正在创建的唯一组合是2,提高到128.可能会创建两次相同的数字.

我最近5年使用COM组件,而没有遇到任何有关GUID的问题.
Unique ID is a 32 bit hexadecimal string and unique combination that is being created is 2 raise to 128. It is randomly created and not possible to create the same number twice.

I am using COM component for last 5 year and not facing any issue regarding GUID.


您好

GUID仅是唯一的.无论如何,它都会在其他计算机上复制,然后转到工具并生成新的GUID.

sanjeev
Hello

GUID is unique only. In any case it gets duplicated on other machine then go to tools and generate new GUID.

sanjeev


这篇关于唯一的GUID问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆