-
Accessing Java code from .NET using COM
I have a Java library that I am trying to access from C# or VB7 through COM.
Does
Microsoft's Java VM support for accessing Java classes as COM objects extend
to the .NET framwork? So far I have been unable to get this to work. I have
included the source for a very simple test case below. The Java code
implements a simple COM object which the C# code calls. In Visual Basic 6 I
can access the COM object fine. In C# or VB7 it works right up to when
the function is called at which time I get a "Not Implemented" exception.
Has anyone else been able to call Java code from a .NET language? Does
anyone know if this is supposed to work?
Thanks,
John
>>> Java code to display a dialog box (Project name COMTest1) :
public class Class1
{
public Class1()
{
}
public void showDialog()
{
com.ms.wfc.ui.MessageBox.show("I'm a Java COM object!", "COM");
}
}
>>> C# code that calls the showDialog() member of the Java COM object:
protected void button1_Click(object sender, System.EventArgs e)
{
COMTest1.Class1 z;
z = new COMTest1.Class1();
z.showDialog();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks