Creating an ActiveX Control from Existing Views Code

You can create an ActiveX control using Views either with the Microsoft Foundation Classes (MFC) library or with the Active Template Library (ATL).

The following two tutorials demonstrate how to create an ActiveX control from an existing Views program.

You will build the ActiveX control from the sample Views program provided in the following file using the ATL COM AppWizard or the MFC ActiveX ControlWizard, depending on the library you choose: manager.cpp

This program displays a map in a manager and allows you to zoom in or out and scroll the map.

You can also create an ActiveX from scratch. The procedure is the same as the one presented in this tutorial.

A knowledge of Views, C++, Visual C++, COM, and the ATL or the MFC library is a prerequisite to work through these tutorials.

Note

The registration of ActiveX controls must be performed with administrative rights. If you are building the control in Visual Studio, you must make sure it was run as Administrator.

Alternatively, you can manually register the control by creating an Administrator command prompt and using the command line regsvr32 /s /c "<PATH_TO>\<CONTROL>.dll".