Conclusions
Using some simple techniques along with f90VB it is very easy to create GUI interfaces for your Fortran programs. The basic process consists of creating Visual Basic forms containing the GUI elements we want, and wrapping them as ActiveX objects that can be accessed through f90VB’s Automation library. You should note that this technique works equally well regardless of the language used to create the ActiveX objects. So you can use f90VB to access ActiveX wrappers created in Delphi, C/C++, Java, or any other language.
When you use Visual Basic to create GUI ActiveX wrappers, it is important to be aware of some limitations imposed by the Visual Basic environment. If all the forms of your project are modal and their associated ActiveX wrappers do not fire events, then you can compile the project into an ActiveX DLL (i.e. as an in-process-server). If your application needs modeless forms, then the forms and their wrapper must be compiled as out-of-process servers (i.e. ActiveX EXEs). This is because Visual Basic does not allow modeless forms to be displayed from non-Visual Basic applications. Although it was not explained in this tutorial, you can use a mixed approach, creating ActiveX EXEs for modeless forms and ActiveX DLLs for modal forms.
Using modal forms that also fire events that bubble-up (through their wrapper classes) to the main application is a risky bet, and should be avoided. There’s nothing to worry about if these events do not bubble-up to the main application. If you need forms that bubble-up events to the main application, a better approach would be to make them modeless forms. However, as explained in the paragraph above, this would force you to put the ActiveX wrappers for these forms into out-of-process servers.
For more information and other articles