Hi,
I am new to vb.net and currently researching about the features available in it. Please apologize if this question does not belong to this category.
In order to call a java class in vb, I found the following procedure and I tried.
(1) create a java class (eg: MyTest .java)
as
public class MyTest
{ public int myfunction(int value1, int value2) { return value1+value2; }
(2) compile to get a MyTest.class
(3)register Mytest.class using javareg.exe file from Microsoft SDK for Java using
javareg /register /class:MyTest /progid:MyTest
and see a MessageBox displayed with Succesfull register Class message
(4) copy MyTest.class to C:\Winnt\Java\Trustlib\
(5) open a New Project on Visual Basic. And paste this brief code on the Form Load event for example and run it. Set x = CreateObject("MyTest") MsgBox x.myfunction(1, 1)
I did all the above steps but when I run the vb program (Step 5), I get the error message "Cannot create ActiveX component". Unhandled Exception message.
I am using Java 1.5 and Visual Studio 2008.
Could you please let me know what I am missing and how to resolve this.
Please let me know if you need additional information to resolve this.
Thanks
Aishwari
I am new to vb.net and currently researching about the features available in it. Please apologize if this question does not belong to this category.
In order to call a java class in vb, I found the following procedure and I tried.
(1) create a java class (eg: MyTest .java)
as
public class MyTest
{ public int myfunction(int value1, int value2) { return value1+value2; }
(2) compile to get a MyTest.class
(3)register Mytest.class using javareg.exe file from Microsoft SDK for Java using
javareg /register /class:MyTest /progid:MyTest
and see a MessageBox displayed with Succesfull register Class message
(4) copy MyTest.class to C:\Winnt\Java\Trustlib\
(5) open a New Project on Visual Basic. And paste this brief code on the Form Load event for example and run it. Set x = CreateObject("MyTest") MsgBox x.myfunction(1, 1)
I did all the above steps but when I run the vb program (Step 5), I get the error message "Cannot create ActiveX component". Unhandled Exception message.
I am using Java 1.5 and Visual Studio 2008.
Could you please let me know what I am missing and how to resolve this.
Please let me know if you need additional information to resolve this.
Thanks
Aishwari