Using the Fortran Module Wizard to Generate Code

An ActiveX control is an Automation object. ActiveX controls typically support methods, properties, and events. ActiveX controls use events to notify an application that something has happened to the control. Common examples of events include clicks on the control, data entered using the keyboard, and changes in the control's state. When these actions occur, the control issues an event to alert the application.

The application, in return, uses methods and properties to communicate with the control. Methods are functions that perform an action on the ActiveX control. For example, you would use a method to tell an Internet Explorer ActiveX control to load a particular URL. Properties hold information about the state of an object, for example, the font being used by a control to draw text.

The Fortran Module Wizard generates Fortran 90 modules that simplify calling COM and Automation objects from Fortran programs. To run the Fortran Module Wizard, in the Tools menu, click Fortran Module Wizard.

The module wizard asks a series of questions. For an ActiveX control, choose the Type Library Containing Automation Information option in the initial Module Wizard screen. In the Type Library screen, choose the ActiveX control that you want to use. Typically, this is a file with a .OCX extension. See the documentation on the ActiveX control to determine its filename. You may select individual components of the ActiveX control to process using the Module Wizard, but typically you can let the wizard default to processing all of the components.

After entering the information and pressing the Generate button, the Fortran Module Wizard asks you for the name of the source file to be generated. It then asks COM to open the type library and generates a file containing Fortran modules. To add the newly created file to your project, in the Project menu, click Add To Project -> Files.

For more information: