基于COM接口编程基础(I).PPT
基于COM接口编程基础(I) Lesson overview COM: 组件对象模型Component Object Model 使用COM类Working with COM classes 接口Interfaces 多态Polymorphism 接口查询QueryInterface 测试一个对象的引用Testing an object reference Is it nothing? What type of object is it? Introducing COM COM is a standard for creating classes Classes can be reused between applications Independent of programming language All ArcObjects are COM classes Technologies based on COM Object Linking and Embedding (OLE) OLE DB ActiveX is any technology built on COM DCOM and COM+ COM classes have interfaces 对象拥有一个或多个接口 接口是定义了一组方法和属性的逻辑关系 与对象的通信是通过接口来进行的 Working with ArcObjects COM classes Instantiate COM classes with an interface Dim variable As some interface Interfaces group properties and methods More on interfaces … 一个组合音响的例子 一个对象可以播放收音机、磁带、CD 必须使用适当的接口 如果选择了播放磁带的接口,则不能收听收音机 多态 许多不同的类可以支持相同的接口 拥有相同的所有的方法和属性 可以有不同的执行方式和拥有不同的属性值 ArcObjects 多态 许多ArcGIS的类都表现出多态的特性 General interfaces for all subtypes ILayer: All layer types (raster, tin, feature, etc.) IGxFile: All ArcCatalog file types (shapefile, map, table, etc.) IActiveView: Map (data view) and PageLayout (layout view) Several others … Using methods and properties Dim the variable pointing to an interface Instantiate the object (Set) Call methods, set properties Only use methods and properties for the declared interface Getting other interfaces QueryInterface (QI) Access other methods and properties Testing an object reference Is an object Nothing? COM class code Interface module 定义方法和属性 Class module 实现方法和属性 Client module 实例化类 使用方法和属性 Using library names Many libraries may share interface or class names 可以明白地引用对象库 Create a new point and line from the esriCore library Dim pPoint As esriCore.IPoint Dim pLine As esriCore.ILine Set pPoint = New Point Set pLine = New Line Using the ESRI Object Browser Lists classes, interfaces, properties, and methods C:\ArcGIS\arcexe83\ArcObjects Developer Kit\Utilities Exercise 6 overview Design an interface Create a COM cl
您可能关注的文档
- 防火墙技术.PPT
- 附表及工作流程图.DOC
- 地方财政分析评价系统使用说明.PPT
- 地球物理勘查及遥感专业(物探).DOC
- 限时测试题-2017年11月.DOC
- 随机有限元法.DOC
- 面向对象的基本概念 面向对象系统开发的原理-2017年11月.PPT
- 地质工程专业 攻读学术型硕士研究生.DOC
- 地铁金融科技大厦、汇通大厦充电桩设备采购及安装招标项目-2017年11月.DOC
- 项目名称新能源纯电动汽车实训设备一组套.DOC
- 广东省广州省实验中学教育集团2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州大学附属中学2025-2026学年八年级上学期奥班期中物理试题(解析版).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(含答案).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(解析版).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 2026《中国人寿上海分公司营销员培训体系优化研究》18000字.docx
- 《生物探究性实验教学》中小学教师资格模拟试题.docx
原创力文档

文档评论(0)