摘要:针对开发基于ATL技术的OpenGL三维图形控件,以及基于OpenGL 的ActiveX 控件的问题,在介绍OpenGL 程序设计流程及ActiveX 控件技术的基础上,归纳了采用MFC 开发ActiveX 控件的一般性方法和步骤,并通过实例说明了该方法的使用。概述了ActiveX 控件和ATL 技术,简介了VC++6.0中如何用ATL技术创建ActiveX 控件。概要地讲述了该工具的研发意义和功能要求以及开发COM控件所涉及到的基本技术,包括图形学理论、MFC技术、基于ATL的COM组件开发技术、OpenGL技术、树形结构的基本运算等技术。
重点介绍了COM组件类层次结构,并说明其中的关键类,对基类CObj3D以及其部分子类做了重要描述,且介绍了部分类的成员函数的实现方法。
关键词: OpenGL ATL COM控件
Abstract:To develop a 3D graph control based on ATL technique and ActiveX control based on OpenGL , in this article , we introduce the procedures of the design of OpenGL and the technique of ActiveX , on the basis of which we summarize the general method and procedure to develop ActiveX control with MFC, and furthermore use an example to describe how to use this method.This article first briefly introduces ActiveX control and ATL Technique and how to create ActiveX controls with the technique of ATL. Then we illustrate the significance of research about this tool, the function requirements and some essential technologies used while developing the COM controls, such as theory of computer graphics, technique of MFC, method of COM component developing, technique of OpenGL and theory of basic operations of tree structures.
We discuss the structure of COM component classes in detail , and highlight those key classes.Detailed descriptions of the base class CObject 3D and part of its sub-classes are made in this article and implementations of some member functions are also introduced.
Key words:OpenGL ATL COM Control
OpenGL是常用的三维图形库之一,其三维场景设计、图元绘制及管理是基于API模式,在实际编程应用中非常不便。本课题的目标是运用VC集成开发环境中ATL技术以类的方式来对API函数来进行封装,编译成轻量型第三方COM组件库,可以在其他开发集成环境中进行使用,使开发效率大为提高。在三维图元管理方面要求采用树形数据结构来进行管理。该课题具有一定的难度,要求掌握ATL接口设计方法,OpenGL API语句及二叉树数据结构的操作。