The FXPLORER sample demonstrates hosting an ActiveX* control in a Fortran dialog box. The control here is that of Microsoft Internet Explorer. When the application is built and run it presents a minimialistic web browser where you can enter a URL and open a page, there are forward and back buttons and a download progress bar.

The interface to the browser, in BROWSER.f90, was generated by the Fortran Module Wizard from the Windows Automation objects defined in Windows\System32\shdocvw.dll This defines constants, types and procedures for interfacing with the browser. Microsoft does not fully document this control - see https://msdn.microsoft.com/en-us/library/aa752044(v=vs.85).aspx for more information.

The structure of the application follows that of a Windowing Application > ActiveX SDI Code project. The main source file is FXPLORER.F90 with a module source FXPLORERGLOBALS.F90 holding global variables. The entry point is the usual WinMain function which creates the window and contains the "message loop" that processes window messages. Most of the procedures in FXPLORER.F90 handle specific window actions, such as resize, menu operations, etc.

CreateChildDialog creates the hosting dialog box and registers handlers for the few browser events the application listens for. What actually references the browser is the IDC_EXPLORER1 dialog defined in the resource file Fxplorer.rc

A Visual Studio solution FXPLORER.sln to build the application is provided. A command-line build script build.bat is also provided.

If you have trouble building this project, make sure that the following folders, or their equivalents, are listed under Tools > Options > Intel Compilers and Tools > Visual Fortran> Compilers> Includes:

If on running the program you see an error that "IFDLGnnn is not registered":

Note: We are aware that an access violation error will sometimes occur when the application exits, if a web page has been displayed in the browser control. In some circumstances, the Windows Compatibility Assistant appears and says that it has made a change to compatibility settings for the application - if it does that, the error no longer appears. This matter is under investigation.