contents   index   previous   next



Converting your Visual Basic Project into an ActiveX EXE

 

If you have compiled the f90VBGUI project as a DLL, it a good idea to un-register this DLL from your system. This would avoid possible confusions when you create the new out-of-process ActiveX server. To un-register the f90VBGUI.DLL, you need to open a command window in the directory where the DLL is located (usually the same directory where your project resides), and then issue the following command:

 

regsvr32 /u f90VBGUI.DLL

 

You should get a message box indicating that the DLL has been un-registered, as illustrated in Figure 14. Once you have taken care of this detail, all you need to do to convert your current ActiveX DLL project into an ActiveX executable project is to click on menu Project/f90VBGUI Properties and select ActiveX EXE in the Project Type window. You can compile your project by selecting File/Make f90VBGUI.exe from the IDE main menu. This completes the work we need to do in Visual Basic.

 

Now let’s take a look of how our ActiveX server is seen from an outside application. To do this open file f90VBGUI.EXE using TLView (Figure 15). Notice that CMain CoClass implements two interfaces, _CMain and __CMain. Interface _CMain is a dual interface, exposing two methods (Show and Hide) and one property fgTable. Interface __CMain is a pure dispatch interface and exposes five methods, which correspond to the events fired by our Visual Basic CMain class. If you click the CMain CoClass, and then select the Interfaces tab on the right panel, you will notice that the __CMain is marked as a source interface, i.e. __CMain is an outgoing interface of the CMain CoClass (Figure 16).


Writing a test main Fortran application