關于什么是GUID,ProgID ,CLSID和UID,在ESRI的Document Library能夠找到下面的描述.

COM interfaces and coclasses are identified by a globally unique identifier (GUID). The GUID for an interface is called an interface ID (IID). The GUID for a coclass is called class ID (CLSID). A ProgID is a text alias for a CLSID; the ProgID is a string composed of the project name and the class name of the coclass.

The UID coclass can be used to represent the GUID of an object.

There is built-in module called ArcID in the VBA project for the Normal template in both ArcMap and ArcCatalog. This module is a utility for finding the UID of the built-in commands and toolbars. You pass the name of a command or toolbar in as an argument to ArcID and the UID of that item is returned. The ArcID module is regenerated every time the Normal template is loaded; the registry is read to get the GUIDs of all the commands and toolbars that are currently used by the application.

簡單的說,GUID(全局统一标识符)是用來標識識別COM接口和組件,保证它們的唯一性,避免出現版本不一致而導致的組件沖突.IID就是接口的GUID表示,CLSID則是組件類的GUID表示。ProgID是程序员给某个CLSID指定一个易记的名字.UID則是物象(Object)的GUID. 以下是一些ILayer接口的UID,通過使用它們,我們可以快速找到所需的圖層。 這些ESRI接口存放在注冊表中的 HKEY_CLASSES_ROOT下面,如果想查詢它們的UID,可以通過查找它們的名字,從而找到對應的UID.


ArcGIS的UID{6CA416B1-E160-11D2-9F4E-00C04F6BC78E} IDataLayer
ArcGIS的UID{40A9E885
-5533-11d0-98BE-00805F7CED21} IFeatureLayer
ArcGIS的UID{E156D7E5
-22AF-11D3-9F99-00C04F6BC78E} IGeoFeatureLayer
ArcGIS的UID{34B2EF81
-F4AC-11D1-A245-080009B6F22B} IGraphicsLayer
ArcGIS的UID{5CEAE408
-4C0A-437F-9DB3-054D83919850} IFDOGraphicsLayer
ArcGIS的UID{0C22A4C7
-DAFD-11D2-9F46-00C04F6BC78E} ICoverageAnnotationLayer
ArcGIS的UID{EDAD6644
-1810-11D1-86AE-0000F8751720} IGroupLayer
ArcGIS的UID{D02371C7
-35F7-11D2-B1F2-00C04F8EDEFF} IRasterLayer


 下面是一個查找groupLayer的例子

End Function

 

 

 

相关文章:

  • 2022-12-23
  • 2021-09-02
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2021-12-26
猜你喜欢
  • 2022-02-16
  • 2021-09-19
  • 2022-01-04
  • 2022-01-07
  • 2022-01-05
  • 2022-12-23
相关资源
相似解决方案