Call Java library using C#

  • Thread starter Thread starter Alan Wang
  • Start date Start date
A

Alan Wang

Hi there:

I am just wondering if I could call java library using C#. The reason to do
that is my application wants to automate OpenOffice and create document.

Thanks in advance

Alan
 
Alan,

I believe Java has the ability to export classes into COM objects. I
would do that. However, I can't imagine it would be too fast, since you are
going to interop through to unmanaged code on the .NET side, and then
marshal from COM to the java runtime.

If the document format is known, you might have better performance
manually creating the file yourself (if this is an issue for you, that is).

Hope this helps.
 
I tried and my program thrown exception "Cannot create ActiveX component."

Please help

Alan
Nicholas Paldino said:
Alan,

I believe Java has the ability to export classes into COM objects. I
would do that. However, I can't imagine it would be too fast, since you
are going to interop through to unmanaged code on the .NET side, and then
marshal from COM to the java runtime.

If the document format is known, you might have better performance
manually creating the file yourself (if this is an issue for you, that
is).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alan Wang said:
Hi there:

I am just wondering if I could call java library using C#. The reason to
do that is my application wants to automate OpenOffice and create
document.

Thanks in advance

Alan
 
Alan,

Did you create a COM interop wrapper? The java utility should be able
to export a type library which you need to set a reference to.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alan Wang said:
I tried and my program thrown exception "Cannot create ActiveX component."

Please help

Alan
Nicholas Paldino said:
Alan,

I believe Java has the ability to export classes into COM objects. I
would do that. However, I can't imagine it would be too fast, since you
are going to interop through to unmanaged code on the .NET side, and then
marshal from COM to the java runtime.

If the document format is known, you might have better performance
manually creating the file yourself (if this is an issue for you, that
is).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alan Wang said:
Hi there:

I am just wondering if I could call java library using C#. The reason to
do that is my application wants to automate OpenOffice and create
document.

Thanks in advance

Alan
 
Back
Top