1.0 Introduction

2.0 ActiveX Overview

3.0 ATL and ActiveX


1.0 Introduction

The HOOPS Stream Contol Integration classes encapsulate the work needed to connect the HOOPS 3D Application Framework with the ATL based Microsoft ActiveX Control template classes. ATL is a collection of templates, macros and classes that provide a more lightweight layer around COM, ActiveX and GUI interaction in the Windows Programing Environment than for example MFC. For more information on ATL and COM please refer to the MSDN documentation. Also various good books have been written on ATL programming. One that we recommend is "Developers Workshop to COM  and ATL 3.0"(ISBN 1-55622-704-3).

Developers who have worked with our MFC based ActiveX component will notice one major conceptual difference with the ATL based integration. The ATL classes are not as easily subclassable as their MFC counterpart. This is due to the nature of ATL and templates programming in particular.  Instead of subclassing we recommend using the code provided by TSA as a direct starting point and so extending/modifying the features of the classes directly. See "Deriving your own Control" for a more in-depth look at this issue.

The HoopsStreamControl integration classes configure various components of the HOOPS 3D Application Framework appropriately for the ActiveX environment and manage control-level issues such as:


 2.0 ActiveX Overview

ActiveX is a platform which allows developers to create content and applications oriented toward the Internet or Intranets.  ActiveX Controls are one of the most common ActiveX technologies used by developers to extend the availability of their technology. They act as programmable objects that can be embedded into any application that is an ActiveX Control Container.  The ActiveX technology includes: 

ActiveX Controls

ActiveX controls (formerly called OLE controls) are objects which may be inserted into Web pages or any documents able to be read by ActiveX container applications (such as the MS Office suite). Examples include buttons, stock tickers, and chart controls. 

ActiveX Documents

ActiveX documents can be displayed by Web browsers or document viewers. Traditional embedded objects were limited to one page and were shown embedded in the document. With ActiveX, the document can be displayed full frame in the entire client area window. 

ActiveX Server Framework

You can extend a Web server to provide customized Web pages using content from a database or an application which runs on the server.

Internet Data Download Services

Data can be downloaded over the Internet using common protocols: HTTP, FTP, and gopher.

Active Scripts

VBScript and other scripting languages connect controls and add interactive functionality to Web pages. Scripting moves processing from the server to the client. For example, form entries can be validated on the client and then sent to the server. 

HTML Extensions 

HTML extensions, such as the object tag, have been added to support controls and scripting.  
 
Return to Index


3.0 ATL and ActiveX

In essence ATL is a lightweight wrapper around the COM (Component Object Model) . It simplifies various COM related tasks as life-cycle management, registration and client/server communication. ActiveX  controls are highly sophisticated COM components which usually have a visual "front-end". ATL also greatly simplifies CASE tool based development in that area. A class that wants to take advantage of ATL based functionality needs to derive from varios ATL template classes, some of which are necessary to any COM development with ATL while others serve only auxiliary purposes as streaming or persistence.
As an example here is an excerpt from the main ATL control class definition which shows the classes it derives from. Again for more information please refer to the MSDN documentation and/or any book covering ATL programming:
class ATL_NO_VTABLE CHoops3dStreamCtrl :

            public CComObjectRootEx<CComSingleThreadModel>,

            public CStockPropImpl<CHoops3dStreamCtrl, IHoops3dStreamCtrl, &IID_IHoops3dStreamCtrl, &LIBID_Hoops3dStreamLib>,

            public CComControl<CHoops3dStreamCtrl>,

            public IPersistStreamInitImpl<CHoops3dStreamCtrl>,

            public IOleControlImpl<CHoops3dStreamCtrl>,

            public IOleObjectImpl<CHoops3dStreamCtrl>,

            public IOleInPlaceActiveObjectImpl<CHoops3dStreamCtrl>,

            public IViewObjectExImpl<CHoops3dStreamCtrl>,

            public IOleInPlaceObjectWindowlessImpl<CHoops3dStreamCtrl>,

            public IConnectionPointContainerImpl<CHoops3dStreamCtrl>,

            public IPersistStorageImpl<CHoops3dStreamCtrl>,

            public ISpecifyPropertyPagesImpl<CHoops3dStreamCtrl>,

            public IQuickActivateImpl<CHoops3dStreamCtrl>,

            public IDataObjectImpl<CHoops3dStreamCtrl>,

            public IProvideClassInfo2Impl<&CLSID_Hoops3dStreamCtrl, &DIID__IHoops3dStreamCtrlEvents, &LIBID_Hoops3dStreamLib>,

            public IPropertyNotifySinkCP<CHoops3dStreamCtrl>,

            public IPersistPropertyBagImpl<CHoops3dStreamCtrl>,

            public CComCoClass<CHoops3dStreamCtrl, &CLSID_Hoops3dStreamCtrl>

. 

The integration of HOOPS/3dAF with the ATL based ActiveX Control consists primarily of connections between HOOPS/MVO and ActiveX base classes.   The HOOPS/MVO toolkit encapsulates the HOOPS/3dGS scene graph and houses the main dispatch between UI events and operations on 3D models.  Details on MVO can be found in the discussion of the HOOPS Model/View/Operator paradigm.

The HOOPS/ActiveX integration classes encapsulate the connection between MVO and ActiveX and implement both HOOPS- and ActiveX-specific functionality.

The HOOPS based ATL Control consists of the following classes:

Choops3dStreamCtrl

This is the main control class which handles nearly all COM/ActiveX related tasks. It also holds pointers to the MVO HBaseModel and HbaseView object as well as HDB.

HCtrlDB

This class is derived from HDB and manages the instance of the HOOPS database, keeping a referece count of the currently active control windows.

HctrlView

Derived from HbaseView this class handles the various visual state changes of the control (edit mode, design mode, etc.), as well as other control specific view functionality

HnetMgr

Encapsulates communication with the Hnet server

HnetClientMgr

Encapsulates communication with the Hnet client

DataLoader

Manages asynchronous streaming of HSF files and other data