ArcGIS的 UID
2013-11-14 17:03
316 查看
关于什么是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.
{6CA416B1-E160-11D2-9F4E-00C04F6BC78E} IDataLayer
{40A9E885-5533-11d0-98BE-00805F7CED21} IFeatureLayer
{E156D7E5-22AF-11D3-9F99-00C04F6BC78E} IGeoFeatureLayer
{34B2EF81-F4AC-11D1-A245-080009B6F22B} IGraphicsLayer
{5CEAE408-4C0A-437F-9DB3-054D83919850} IFDOGraphicsLayer
{0C22A4C7-DAFD-11D2-9F46-00C04F6BC78E} ICoverageAnnotationLayer
{EDAD6644-1810-11D1-86AE-0000F8751720} IGroupLayer
{D02371C7-35F7-11D2-B1F2-00C04F8EDEFF} IRasterLayer
下面是一个查找groupLayer的例子
Public Function FindGroupLayer()Function FindGroupLayer(ByVal sGroupName_IN As String, ByRef pmap_IN As IMap) As ILayer
On Error GoTo errhandle
Dim Result As ILayer
Set Result = Nothing
Dim pL As IGroupLayer
Dim pel As IEnumLayer
Dim uid As New uid
uid.Value = "{EDAD6644-1810-11D1-86AE-0000F8751720}"
Set pel = pmap_IN.Layers(uid, True)
Set pL = pel.Next
Dim sGroupName As String
sGroupName = UCase(sGroupName_IN)
While Not pL Is Nothing
If UCase(pL.Name) = sGroupName Then
Set FindGroupLayer = pL
Exit Function
End If
Set pL = pel.Next
Wend
Set FindGroupLayer = Result
Exit Function
errhandle:
'MsgBox "FindgroupLayer Error: " & Err.Description
Set FindGroupLayer = Nothing
End Function
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.
{6CA416B1-E160-11D2-9F4E-00C04F6BC78E} IDataLayer
{40A9E885-5533-11d0-98BE-00805F7CED21} IFeatureLayer
{E156D7E5-22AF-11D3-9F99-00C04F6BC78E} IGeoFeatureLayer
{34B2EF81-F4AC-11D1-A245-080009B6F22B} IGraphicsLayer
{5CEAE408-4C0A-437F-9DB3-054D83919850} IFDOGraphicsLayer
{0C22A4C7-DAFD-11D2-9F46-00C04F6BC78E} ICoverageAnnotationLayer
{EDAD6644-1810-11D1-86AE-0000F8751720} IGroupLayer
{D02371C7-35F7-11D2-B1F2-00C04F8EDEFF} IRasterLayer
下面是一个查找groupLayer的例子
Public Function FindGroupLayer()Function FindGroupLayer(ByVal sGroupName_IN As String, ByRef pmap_IN As IMap) As ILayer
On Error GoTo errhandle
Dim Result As ILayer
Set Result = Nothing
Dim pL As IGroupLayer
Dim pel As IEnumLayer
Dim uid As New uid
uid.Value = "{EDAD6644-1810-11D1-86AE-0000F8751720}"
Set pel = pmap_IN.Layers(uid, True)
Set pL = pel.Next
Dim sGroupName As String
sGroupName = UCase(sGroupName_IN)
While Not pL Is Nothing
If UCase(pL.Name) = sGroupName Then
Set FindGroupLayer = pL
Exit Function
End If
Set pL = pel.Next
Wend
Set FindGroupLayer = Result
Exit Function
errhandle:
'MsgBox "FindgroupLayer Error: " & Err.Description
Set FindGroupLayer = Nothing
End Function
相关文章推荐
- ArcGIS UID的用法
- ArcGIS的UID
- ArcGIS API for Android 案例教程 4
- Arcgis 几何网络分析
- arcgis连接oracle
- ArcGIS API for Android 案例教程 12
- ARCGIS 10.1 for Server SOE介绍及开发实例(2)
- ArcGIS License Server10.3利用cmd命令启动方法
- ArcGIS Diagrammer介绍
- ARcGIS坐标变换
- ArcGIS for IOS 10.2.5坐标系转换
- ArcGIS API for Silverlight中通过https访问rest服务
- ArcGIS For Flex学习之Mapping---Select and zoom
- Intellij Idea 自动生成serialVersionUID的方法
- 使用ArcGIS Mobile SDK 9.3 开发移动设备应用-初级篇(zz)(转稿)
- Android中的UID、GID与应用安全
- Arcgis Runtime for andriod 100 加载TPK
- Win7专业版 下安装ArcGIS 9.3总结
- C#语言实现ArcGIS数据源重置之Set Data Source功能
- 汇总统计数据工具—你所不知道的arcgis工具