This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Accessing GCJ binaries from Visual Basic?
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: java at gcc dot gnu dot org, Andrzej Bialecki <ab at getopt dot org>
- Date: Thu, 11 Aug 2005 18:04:23 -0500
- Subject: Re: Accessing GCJ binaries from Visual Basic?
- Reply-to: gnustuff at thisiscool dot com
Hi Andrzej,
>Now, my question is how should I wrap in VB the return result of
>getLink(), or handle the argument to setLink method to be able to use
>them transparently in VB, without re-packaging all results and arguments
>into VB primitive types?
That's the ugly part, unfortunately. I can't quite remember what the
VB primitive types are (I only have a cursory knowledge of the language),
but I'm afraid you'll have to cast a Test* to a void*, then an int or a long
or something like that. The same applies for the setter. To wrap a
class and its methods, you create a flat C API for the methods
in that class, the first argument of which is a class instance upcast
to an int or some other VB pointer type (if VB has one). In the C
wrapper code, you downcast the int or long handle to an instance
pointer and proceed from there. Loads of fun.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/