This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Accessing GCJ binaries from Visual Basic?


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/




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]