Re: Passing Interfaces from COM to Java

Cyril <[email protected]>
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <000f01c46088$caf13280$0101c80a@home1kvb86k4sm>
Hi Maxym,
it looks like you born in Ukraine (or your forefathers) like me. About your
second question. If your interface is derived from IDispatch you can pass
its reference to Java-COM bridge (I am not sure that it is possible in jawin
but in my clone of jawin it is possible). Another issue. If your interface
is derived from IUnknown but it is oleautomation compatible then it can be
used like IDiaspatch (I will add this option to my code in few days). And
more complex case: your C++ class/structure is oleautomation compatible (all
types are compatible with oleautomation and public member variables are
accessible with get/set functions). Such class/structure pointer can be
converted to IDispatch in runtime (see CreateStdDispatch in MSDN) and used
with oleautomation SDK. But this option is not supported in jawin.

Regards,
Vitaly Shelest


----- Original Message -----
From: "Maxym Mykhalchuk" <[email protected]>
Newsgroups: gmane.comp.windows.devel.jawin
Sent: Friday, July 02, 2004 8:52 PM
Subject: Passing Interfaces from COM to Java


> Hi All,
>
> I'm new to this list, so let me thank all Jawin developers for their
> hard work in creating such a nice piece of software.
>
> Of course, if I would be just a simple happy user, I wouldn't bother
> you writing to this list, but there's a problem (even two), and I
> hope you may advise the solution.
>
> First of all, Jawin Type Browser (1.4 beta) cannot create Java stubs
> for mshtml.tlb (on my XP box): when I try to create a project with
> it, TypeBrowser just throws an exception "org.jawin.COMException:
> 80070057: null"
>
> Second problem is kind of trivial, but I couldn't find the solution
> anywhere, because everywhere in Jawin docs it's assumed that we
> create COM objects from Java. However, how can I pass an interface
> from the C++ code to Java code?
> (I mean, in my C++ code I create Java Virtual Machine, load my class
> into it, and I try to pass an interface from my C++ code to my Java
> code)
>
> Sincerely yours,
> Maxym Mykhalchuk
>
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.