[quoted text, click to view] > I'm going to be writing a DLL in VS C++ that will be used by the Java team
> here. They're using Sun Java and I'll structure the DLL so that the normal
> JNI will work for them. I'd like to test my DLL though in J# but a simple
> example seems to indicate J# may not support it. For example, I could not
> get this code to compile:
>
> class HelloWorld {
> public native void displayHelloWorld();
>
> static {
> System.loadLibrary("hello");
> }
>
> public static void main(String[] args) {
> new HelloWorld().displayHelloWorld();
> }
> }
>
> This compiles of course under Sun Java. How do I do the same with J#?
you can use interfaces for the pure Java code to talk to and have different
implementations for Java (using JNI) and J# (using P/Invoke or whatever) if
your code needs to work in both Sun Java and J#
hope sometime in the future the J# team (or other company) will add some JNI
support to J#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <birbilis@kagi.com> [Microsoft MVP J#]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis + Robotics
http://www.mech.upatras.gr/~robgroup
.........................................................................