Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

COM interop with vjreg & vexegen; overloaded methods

4 views
Skip to first unread message

Vicke Lööd

unread,
Sep 1, 2008, 6:38:56 AM9/1/08
to
Microsoft SDK for Java 4.0 comes with two tools; vjreg (which
generates type libraries from Visual Java classes) and vexegen (which
generates portable executables from Visual Java classes).

It looks like vjreg and/or vexegen are smart enough to turn overloaded
Java methods into single COM methods using optional parameters, like
this:

void Method()
void Method(string s)
void Method(string s, int a) <-- Java methods

==>

void Method([string s[, int a]]) <-- COM method in DLL type library

Is this correct? I can't find much in the documentation. But it seems
correct.

Now, my real question is, is there any way to replicate this behavior
for the current generation (2008) of Microsoft tools? If I convert the
Java code to .NET code using the Java Code Conversion Assistant and
then expose that .NET code to COM, overloaded Java/.NET methods are
turned into one COM method per overload no matter how I do it. So,
maybe I shouldn't use the Code Conversion Assistant, but go directly
to COM somehow. But since there is no Microsoft JVM anymore, is this
even possible?

0 new messages