JBoss with Visual Basic

Back ] Up ] Next ]


Type library generation is made of Java introspection and COM interfaces generation. Sun provides a tool called typelibgen to create the COM Type Library. Bug or not, I was unable to use it with the -jar option. Note that this tool is only a Java class. So I made my batch : convert.bat.

  1. Extract the file named client.jar from the tomcat-test.ear file. Put it in the client directory of your JBoss distribution.
  2. Just launch the batch, and if your environment is properly set (COMBRIDGE_HOME and JBOSS_HOME), you should see in the ouput directory of your bridge installation two new files :
    • org_jboss_test_tomcat_ejb_interfaces_StatelessSession.tlb
    • org_jboss_test_tomcat_ejb_interfaces_StatelessSessionHome.tlb

These files are the Type Library for the Remote and the Home interfaces of the EJB. Note that the Type Library generation registers automaticaly the TypeLib in the registry.

Launch Visual Basic. Create a new project. Choose Standard EXE Application.
Go the Project/Components menu. Select the following component (Figure 1) :

  • J2EECAS JvmControl 1.0 Type Library
Figure 1

Go the Project/References menu. Select the following references (Figure 2) :

  • J2EECAS JBossServices 1.0 Type Library
  • J2EECAS JvmControl 1.0 Type Library
  • J2EECAS Java Services 1.0 Type Library (if you want dynamic Java instantiation)
  • org_jboss_test_tomcat_ejb_interfaces_StatelessSession (the typelib you have just created for the remote interface)
  • org_jboss_test_tomcat_ejb_interfaces_StatelessSessionHome (the typelib you have just created for the home interface)
Figure 2

In the default form, create two label controls, two text control and one button. The second text control must have its MultiLine attribute set to true. The form should look like Figure 3.

Figure 3

Double-click on the button to access the code. The source code should look like the Figure 4.

Figure 4

Launch your application. You should see the application as shown in Figure 5. Close your eyes, press the button and...

Figure 5

The result should be the Figure 6.

Figure 6

Yeah, it works !!!


Back ] Up ] Next ]

The informations below are given without any warranty of any kind.
Comments can be sent to letiemble@users.sourceforge.net