Java JNI: use a c# dll?

Hi there, I am working on a Windows XP machine. I work as part of a project, and so part of the needed code are written in different languages. As it happens, Java needs to use code written in c#.
There are more than one question here, really.
1) can I create an object defined in the dll in the Java code using JNI?
2) If it absolutely needed to be could I create a GUI in Java, and can I send the window handle as argument into the dll? (when I talk about window handle I mean the thing that I would retrieve in c# on a textBox using textBox.Handle.toInt32())
3) I heard there also exist sockets. Could you please specify the big difference between them and which one is better?
Thanks a lot.
Vic_code

I believe that jshell was actuall referring to the COM interface.
COM stands for Common Object Model and is a popular way in Windows for applications and components to communicate. It is nearly a synonym for ActiveX.
It is easy to add a COM interface to a C# class. All you have to do is to add the COMVisible=true attrribute to the class.
You can also use the project settings to expose the entire program to COM.
Either way, you should check the box for "Register for COM Interop" under Build in project settings.
Once your C# class has a COM interface, use jacob to access its properties and methods.
Here is example code for accessing Visual Studio from a java app:
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Variant;
import com.jacob.com.Dispatch;
public class VisualStudioApp
private ActiveXComponent m_vsApp;
public VisualStudioApp() throws VisualStudioException
string vsVer = "VisualStudio.DTE";
m_vsApp = ActiveXComponent.connectToActiveInstance(vsVer);
if (null == m_vsApp)
m_vsApp = ActiveXComponent.createNewInstance(vsVer);
if (null != m_vsApp)
if (!MainWindow().GetVisible())
MainWindow().SetVisible(true);
if (!GetUserControl())
SetUserControl(true);
// other methods and properties as needed...
}You fill in other properties and methods as methods in the java class. For instance, the MainWindow property of the VisualStudioApp looks like:
public MainWindow MainWindow()
if (null == m_vsApp)
return null;
Variant win = m_vsApp.getProperty("MainWindow");
return new MainWindow(win.getDispatch());
}and the MainWindow class (corresponding to a MainWindow class probably written in C++ for Visual Studio but who cares) looks like:
public class MainWindow
protected Dispatch m_pDisp;
public MainWindow(Dispatch pDisp) { m_pDisp = pDisp; }
@Override protected void finalize() { m_pDisp.safeRelease(); m_pDisp = null; }
public void SetFocus()
Dispatch.call(m_pDisp, "SetFocus");
// other properties and methods here...
}Edited by: mozzis on May 21, 2009 11:10 AM
Edited by: mozzis on May 21, 2009 11:14 AM

Similar Messages

  • Can not locate Java class using JNI within C++ DLL

    I am using trying to use JNI to call a Java class from C++. The Java class uses JMS to send messages to a JMS message queue. At first I coded the C++ in a console application that created the JavaVM and used JNI to access the Java class. All worked fine. Then I called the Java class using JNI from threads and ran into the problem of the Java class not able to locate the JMS related classes. This was solved by placing the following line in the constructor of the Java class.
    Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
    Then I moved the JNI code from a console application to a DLL in specific an extension DLL that is called by SQL Server or Oracle server. The DLL will use JNI to call the Java class and send messages to a JMS message queue.
    The problem I am having now when the DLL code is called by SQL Server the call to
    JNI_CreateJavaVM
    appears to work correctly but the call to find the Java class using
    jvmEnv->FindClass(pName)
    fails. It appears the is a class loading problem which occurs due to the fact JNI is called from a DLL. When the VM is created I pass the class path information using the statement
    -Djava.class.path=
    And as I stated before it all works when running from a console application. I am new to JNI and really need help in the form of some sample code that will solve this problem. I believe I need to somehow load the classpath information from the DLL but I can not find examples on how to do this using JNI. I have tried several ways using URLClassLoader and getSystemClassLoader from JNI and either it does not work or it crashes very badly.
    I used the following code to determine what the existing class path is and the string returns empty.
    jcls = jvmEnv->FindClass("java/lang/System");
    jmid = jvmEnv->GetStaticMethodID(jcls, "getProperty", "(Ljava/lang/String;)Ljava/lang/String;");
    jstrClassPath = jvmEnv->NewStringUTF("java.class.path");
    jstr = (jstring)jvmEnv->CallStaticObjectMethod(jcls, jmid, jstrClassPath);
    m_jstr = (jstring)jvmEnv->NewGlobalRef(jstr);
    pstr = jvmEnv->GetStringUTFChars(m_jstr, 0);
    Can anyone please help with example code that will solve this problem. Thanks in advance for any help.
    Charles�

    I have determined the problem occurs when the application/component is compiled using VC 6.0. The test application was compiled using VC 7.1 and works correctly by locating the class path information. If the test application is compiled using VC 6.0 it has the same problem.
    The jvm.dll I am using is version 1.4.2.80. Currently this is not an option to compile all the applications that use JNI using VC 7.1 so can someone please tell me how to solve this problem.

  • How can i call a VB6 project from my java application using JNI

    hi
    can anyone tell me the procedure of calling a VB6 project from any java application using JNI
    if anyone does know then tell me the detail procedure of doing that. I know that i have to create a dll of that VB6 project then to call it from the java application.
    if anyone know that procedure of creating dll file of an existing VB6 project please reply
    please if anyone know then let me know

    Ahh, kind of a duplicate thread:
    http://forums.java.sun.com/thread.jspa?threadID=631642
    @OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to use a C# dll with JNI

    After a ton of issues, I finally got this working properly. I've come across a lot of forum posts about the various problems and VERY few answers so I thought I would post my solution here.
    To do this, you need to create a managed C++ layer in between C# and java. The JNI functions in C++ dll can make calls to the C# dll directly, and your java program can make calls directly to the native JNI functions. Some important notes on using C# classes in C++ are:
    -gcroot<CSClass ^> should be used on any objects that are instances of some C# class.
    -the symbol ^ should be used with all C# references (its the symbol for references)
    -gcnew should be used to allocate C# objects
    -in visual studio, add the C# dll as a reference rather than using #using <CsDLL.dll>
    -do not use #using <CsDLL.dll>
    The next issue is loading the libraries. By adding the folder your C++ dll is located in to the Djava.library.path VM argument, you can load your C++ library with System.LoadLibrary("Cppdll.dll"). You DO NOT need to load the C# dll in your java program. In fact, it will ignore you if you try. The problem with loading this dll is with how the CLR searches for referenced assemblies. The CLR First searches the DEVPATH environment variable (if the machine.config file has developer mode set to on), then it searches the GAC, then it searches the codebases, then it searchs the current executable's directory along with a list of definable subdirectories (probes).
    DEVPATH is a decent option, but it requires modifying the machine.config file to be in developer mode. Once that is done, it acts just like the PATH environment variable.
    If your C# dlls are strongly named, I would recommend adding them to the GAC or using codebases. However I have not done this and am not sure how.

    Hi,
    i have to use a c# dll in my java program .by following this link http://www.codeproject.com/KB/cross-platform/javacsharp.aspx i done that.but it is working for only one c# program.if i am trying to use a dll it is throwing error
    # An unexpected error has been detected by Java Runtime Environment:
    # Internal Error (0xe0434f4d), pid=3988, tid=3704
    # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86)
    # Problematic frame:
    # C [kernel32.dll+0x442eb]
    # An error report file with more information is saved as:
    # D:\Work\EclipseWorkspace\HelloInflux\hs_err_pid3988.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    Please help me out. i want a few steps to invoke a c# dll by using jni

  • Using java jni

    Hello,
    I'm trying to figure out a way to start small Java-Programs from within
    Labview 6.0.1. Does anybody know how to do this? Every time I use the
    call dll-function to invoke the java-jni api Labview crashes. Invoking
    Java via the active-x plugin doesn't work either.
    Any suggestions are welcome. Thanks.
    Norman Südekum

    Norman,
    Try updating to LabVIEW 6.0.2 to get all of the ActiveX fixes and try the ActiveX method again. (You cannot do this if you only have the Evaluation version.) You can also call java from the System Exec.vi if you do not need data directly back (you can transfer it many other ways: files, TCP, pipes, etc).
    Also, see the following:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=506500000008000000102D0000&ECategory=LabVIEW.LabVIEW+General
    http://digital.ni.com/public.nsf/websearch/BEE812007BA2A9B486256BC80068A49A?OpenDocument
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • If I use "JSP - Java - JNI" ??

    When the Java -> JNI -> C is writen and tested OK.
    How can I use JSP to import the Class into JSP page???
    I tried. But failure.
    Have someone show a sample?? help~ Q_Q

    Thanks you again... ^_^ to help
    All My step and files are shown below:
    --[1 step]--------[ JSP file ]--------------------------
    <jsp:useBean id="myBean" scope="page" class="Counter"/>
    <jsp:getProperty name="myBean" property="count"/>
    --[2 step]---------[ write JavaBean ]-----------------
    public class Counter{
    public Counter(){}
    public native String printt(); // It's Native entry
    public static void main(String[] args){ // This just for Java in DOS runable.
    new Counter().printt();
    public String getCount(){
    return(new Counter().printt());
    @@@@@@@@@@@@@@@@ <= the server will call getCount() method, which the DLL's create the printt() method.it may cause the 1st errors because can't find printt().I guess.
    public void setCount(int newCount){}
    static{
    System.loadLibrary("HelloWorld"); //LOAD the DLL's from C create
    ---[3 step]------ [ Create Counter.h ] -- CMD:[ javah - jni Counter ]---------
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class Counter */
    #ifndef IncludedCounter
    #define IncludedCounter
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: Counter
    * Method: printt
    * Signature: ()Ljava/lang/String;
    JNIEXPORT jstring JNICALL Java_Counter_printt
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif
    ----[4 step]--- [Write HelloWorld.c ]-------------
    #include <jni.h>
    #include <stdio.h>
    #include "Counter.h"
    JNIEXPORT jstring JNICALL
    Java_Counter_printt(JNIEnv *env,jobject this){
    printf("Hello World!\n hihihi success!");
    return;
    ---[5 step]-- [use VC++ 5 to create the DLL from HelloWorld.c ]
    ---[6 step] ----- The result that Server says -------
    500 Internal Server Error
    java.lang.NoClassDefFoundError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:195)
    ...

  • Problems creating a Java Array using JNI-HELP!

    Hi,
    I am trying to create a Java Array using JNI.I have posted the code below. The problem is that the oth element is added correctly to the Array but when the JVM gets to the next element...it goes for a toss. It is not able to create a new instance of the object in GetUGEntity() function...there seems to be some problem in creating a new instance of the object!
    Can somebody help me with this?
    jobject GetUGEntity(JNIEnv *env, UF_DISP_j3d_entity_t* entity_list)
         int numVerts=0, numStrips=0;
         jfieldID fid;
         jdoubleArray jTransform=NULL;
         jstring jstrName=NULL;
         jdoubleArray jNormals=NULL;
         //Init an Entity object
         cout<< "**Getting New Class Reference...";
         jclass jEntity = env->FindClass("Lcom/wipro/java3d/rmi/Entity;");
         cout << "**got Class reference..."<<endl;
         if (jEntity == NULL)
              return NULL;
         cout<<"Creating new object instance...";
         jmethodID mIDInit = env->GetMethodID(jEntity, "<init>", "()V");
         cout<<"Got java method id...";
         jobject javaObj = env->NewObject(jEntity, mIDInit);
         if (javaObj==NULL)
              return NULL;
         cout << "Created!" << endl;
         //Entity ID
         cout<< "**Setting eid...";
         fid=env->GetFieldID(jEntity,"eid","I");
         jint eid = (jint)(entity_list)->eid;
         env->SetIntField(javaObj, fid, eid);
         //env->DeleteLocalRef(eid);
         cout << "Done!" << endl;
         cout << "Done!" << endl;
         cout<< "**Returning jobject...";
         return javaObj;
    jobjectArray createJArray(JNIEnv* env, UF_DISP_j3d_entity_t** entity_list, int noOfEntities )
         UF_DISP_j3d_entity_t* tempVar=NULL;
         cout<<"*Creating Jobjectarray...";
         jobjectArray jEntityArray = (jobjectArray) env->NewObjectArray(noOfEntities,
              env->FindClass("Lcom/wipro/java3d/rmi/Entity;"),NULL);
         cout<<"Created!"<<endl;
         for(int i=0; i<noOfEntities;++i)
              tempVar = &(*entity_list);
              if (tempVar !=NULL)
                   cout<<"*Trying to get Entity...."<<endl;
                   jobject jEntity = GetUGEntity(env, tempVar);
                   if (jEntity!= NULL)
                        cout<<"Got Entity!" <<endl;
                        cout <<"*Setting Array Element....";
                        env->SetObjectArrayElement(jEntityArray, i, jEntity);
                        cout << "Done!" << endl;
                   else
                        printf("ERROR: Did not get Entity Reference");
              else
                   printf("ERROR: Got a NULL Reference!");
         return jEntityArray;

    Hi Deepak,
    Could you please let us know upto which line your code is going safe. Try printing the value in the structure before you send that to the method GetUGEntity().
    I am not too sure that would be a problem. But I have faced a problem like this, wherein I tried to access a structure for which I have not allocated memory and hence got exception because of that.
    Since your JNI code seems to be error free, I got doubt on your C part. Sorry.
    Dhamo.

  • How to instantiate a java object (using JNI)?(n'more)

    hey bschauwe, thanks for your last post, you were guessing but your 4th guess was right on the money of how id like to do it.
    "4. An alternative way to return data to java from C is to instantiate a java object (using JNI), then use JNI to call that object's setters, then return the object at the end of the C routine."
    I know now how to get the object's setters, I am just unsure how to instantiate a java object from the native C code using JNI. Also you said to returnt he object at the end of the c routine, that is just a good ol' return statement right? no other functions to release memory or anything are needed? So basically it would be something like:
    JNIEXPORT jobject retObj JNICALL Java_AbfaRegion_getJSourceData
      (JNIEnv *env, jobject thisObj)
            //instantiate the java object on retObj????
            //call setters with values from the c structures...
            //return retObj??? no other memory releasing needed?
    }Thanks again for all your help,
    Shane

    K sounds straight forward enough, the index in my book had nothing on <init> and I wasnt aware of the NewObject call. So my final (well for demonstration purposes) code should look something like:
    JNIEXPORT jobject retObj JNICALL Java_AbfaRegion_getJSourceData
      (JNIEnv *env, jobject thisObj)
         jclass clazz;
         jclass clazzTemp;
         jmethodID mid;
         jint val;
         jobject tempObj;
            //first instanciate the object
         clazz = (*env)->GetObjectClass(env, retObj);
         mid  = (*env)->GetMethodID(env, clazz, "<init>", "()V");     
            //Get Object
         tempObj = (*env)->NewObject(env, clazz, mid);
            //get Class reference to instantiated class
         clazzTemp = (*env)->GetObjectClass(env, tempObj);
            //Start calling setters to set the object up.
         mid = (*env)->GetMethodID(env, clazzTemp, "SetHeight", "(I)V");
         (*env)->CallVoidMethod(env,tempObj, mid, struct->myHeight);
            //set more members ...
            //return the object back to java with its members filled out.
            //before returning do I need to call (*env)->DeleteLocalRef(tempObj); ??
            return tempObj;
    }So is this how i do it for a function that is nativly defined as:
    public native JSources getJSourceData();?
    if this is right, then im cooking, and cannot thank you enough!
    -Shane

  • How to get a handle which is used in c dll from  javax.smartcardio.card

    good afternoon
    i am using javax.smartcardio.card to operate a sim-card reader .
    but i have a dll which is call sim-card reader by handle.
    how can i get a handle from a javax.smartcardio.card object to pass to the dll
    next is the code .
    c dll prototype declaration
    char DoFormat([in] unsigned long P1�C[in] char * P2�C[in] bool P3,[in][out] char *P4)P1 is a handle
    java code:
    private boolean checkCardReader(boolean isopen)
    boolean r=false;
    try {
    javax.smartcardio.card card;
    TerminalFactory factory = TerminalFactory.getDefault();
    List terminalList = factory.terminals().list();
    terminal = (CardTerminal) terminalList.get(0);
    // establish a connection with the card
    card = terminal.connect("T=0");
    channel = card.getBasicChannel();
    //how can i get a handle which can be used by windows dll .
    }catch (Exception ex)
    System.out.println("Exception : " + ex);
    return r;
    *****************************************************************

    Presumably you are calling a C library method that returns a handle.
    Normally a handle will be a integer type value.
    With such a value you can cast it into a java integer type and then cast it back in different JNI code by passing it to those routines.
    A java long is as big as you can get and will hold most every normal type handle item. You should however verify sizes.

  • How to use function in dll file

    hi
    i am new to jni. i want use the function declared in the dll function. i am also having the .h header file.
    can anybody please help me out with this?
    thank you
    suhas

    What kind of function? Function with name created
    with javah generated name or arbitrary function? In
    first case load library and just use "function()", in
    second case you should call something like "rundll"
    under Windows or create wrapper to call from Java and
    redirect call to DLL function itself.Thanks for the reply Michel,
    Actually I have connected RFID 6500 module to PC through com port. and want send request for which module gives response.
    The commands for the module are declared in FeCom.dll and also in FeCom.h. The definitions of the functions are given in FeComDef.h.
    Now I get problem while accessing function in these files.
    did you get the problem?
    waiting for reply
    Thank you,
    suhas

  • Java Application using Swig Running Visual C++ 6.0

    i,
    I am using Swig with Java ,I'm trying launch a Java application using a Windows executable,
    I'm using VC++6.0, and followed the instruction in Swig Documentation chaper 20,Section 20.2.8.
    I Build my dll in Vc++ i get this error Anyone know this,please help me.
         SWIG
         Compiling resources...
         Compiling...
         StdAfx.cpp
         Compiling...
         example.c
         Generating Code...
         Compiling...
         example_wrap.cpp
    c:\program files\java\jdk1.5.0_01\include\jni.h(46) : error C2146: syntax error : missing ';' before identifier 'jsize'
    c:\program files\java\jdk1.5.0_01\include\jni.h(46) : fatal error C1004: unexpected end of file found
    Generating Code...
    Error executing cl.exe.
    example.dll - 2 error(s), 0 warning(s)
    Regards
    Devi

    check on line 46, there might be a missing ";"
    c:\program files\java\jdk1.5.0_01\include\jni.h(46) : error C2146: syntax error : missing ';' before identifier 'jsize'

  • Use an external DLL

    Hello
    I would like to use an external DLL (wrote in C language) in my J2EE application.
    how to set the JDEV (10.1.3.2.0) ?
    Tanks in advance.
    Benoît

    Benoit,
    Google around for JNI (the "classic" and "somewhat difficult to implement" way of doing this), or JNA (the "newer," "easier in most cases," and "not-part-of-standard-java-so-you'll-have-to-download-something" way).
    I myself have used JNA in JDeveloper - it's really quite straightforward.
    Best,
    John

  • Call Java functions in a C DLL

    Hi,
    I am develop a dynamic link library in C on AIX that will internally call java functions using JNI. This libaray will be finally used by other C Executable.
    There is only one function in C code i.e. Connect. This function internally use JNI and call java functions. Now while compiling I am facing problems. I think that there is some problem with my makefile.
    The make file is given hereunder:
    JAVA_HOME = /usr/java14
    JAVA_INC = $(JAVA_HOME)/include
    CC = cc
    LD = cc
    # Flags to create a dynamic library.
    DYNLINKFLAGS =  -G -ostdlib -bnoentry -bM:SRE -brtl -bE:Interface.exp
    # files removal
    RM = rm -f
    #------------------------------------- Libs -----------------------------------#
    JAVALIBS      = -L$(JAVA_HOME)/jre/bin/classic/
    LIBS            = -ljvm -lpthread  -lxnet -lnsl -lm -ldl
    #-------------------------------- Dependency rules---------------------------#
    # shared library files
    LIB_FILES = Interface.a
    #-------------------------------------OBJs-------------------------------------#
    # shared libraries object files
    LIB_OBJS    = Interface.o
    all: $(LIB_FILES)
    # create our librarys
    Interface.a: Interface.o
         $(LD) $(DYNLINKFLAGS) $(JAVALIBS) $(LIBS) $(LIB_OBJS) -o $@
    # compile C source files into object files.
    %.o: %.c
         $(CC) $(DYNLINKFLAGS) -L$(JAVA_INC) -c $<
    # clean everything
    clean:
         $(RM) $(LIB_OBJS) $(LIB_FILES)
    # clean the library's object files only
    cleanlibobjs:
         $(RM) $(LIB_OBJS)Now the problem is that the size of the Interface.a file is very small only 552 bytes. whereas the size of Interface.o file is 34428. Which clearly indicates that the problem is with the Interface.a file i.e during linking.
    Can any body help me to figure out the problem.
    Regards,
    Ahmad Jalil Qarshi

    I guess, you are better off to ask this question in a C forum. This is a Java forum, you know.

  • Deployment of Java App with 3rd party dll

    Hi,
    I am developing one application on windows environment. I am using netbeans 6.0 as my IDE. in this application I have to use 3rd party dll along with one 3rd party jar library. this jar library hides all the implementation of the native methods. So i don't have to use native methods in my application directly which means that I just need to call the java classes of the vendors jar library. I am able to execute the application in Netbeans. but I am not able to deploy the application. I want to know that how should i deploy my application which will be simple jar with vendors library and the dlls, so that user just have to run the application just through the command line( java -jar myapp.jar)

    no you didn't understood the question. Wrong.
    I understood the question.
    You however didn't understand the response.
    So let me expand on it.
    The library consists of java and dlls. There is absolutely no way that it will run on a client box without the dlls. So they must be delivered in some way.
    Now I suppose they could have encrypted/packed the dlls in some fashion but that isn't likely. And if it is then the java code of the library is responsible for loading them and there will be nothing you can do about it.
    Excluding that.....
    Shared libraries can ONLY be loaded via one of the following methods.
    1. The dlls must be in the PATH environment of the application
    2. The path must be explicitly provided in the application.
    For the libraries you have one of the following will be true
    1. The dlls must be in the PATH environment of the application
    2. The path must be explicitly provided from your code and passed to the library code.
    3. You must explicitly load the dlls in your code and hope that the library code is smart enough to deal with it.
    For option 2 the library must provide a method for you to pass a path.
    For option 3 the library code must be written to support this.
    For option 1 you will need to modify the client in some way to provide for the PATH (which you can do in various ways, none of which have anything to do with Java specifically although 'WebStart' or whatever it is called might do it.)

  • Mapping struct dataype in C to Java JNI

    Do anyone have idea how to map struct datatype in C to Java JNI?
    I've got idea and examples of mapping primitive datatype and array in C to Java JNI but none for struct datatype in C?
    Hope I can got an example of it! Thanks!!!

    The first way - by the book
    Read Sheng Liang's book (downloadable from ftp://ftp.javasoft.com/docs/specs/jni.pdf )
    In brief - and explaining only the main steps - no detailed instructions - please read the book
    You want to return an array of the following objects (they have only primitive data, for easing the explanation)
    //-- C++
    struct MyData {
        int firstField;
        char *secondField;
    //-- Java
    public class MyData {
        public int firstField;
        public String secondField;
    }in the native Java method "doSomething" of the class MyProgram
    public class MyProgram {
        static {
            System.loadLibrary ("myjni");
        public static native MyData[] doSomething() ;
    }You will have to call JNI functions for creating the MyData[] array, for creating individual MyData objects, and for setting the individual fields of each MyData object. Very boring indeed.
    The second way - the hard one
    Instead of returning a Java array of Java objects, study the serialization format of Java, and return a Java array of bytes. Then use ByteArrayInputStream and ObjectInputStream, or DataInputStream, for deserializing the objects you do need to get in your program. It will be slower than creating directly the Java objects in your C++ program, but you can save a few lines of code in your C++ program. (You will maintain the program yourself, don't you?)
    The third way - the lazy one
    Instead of returning a Java array of Java objects, return a Java String (it could be a XML-formatted string, or a string using delimiters - what you think that is easier to encode in C++ and decode in Java.)
    The third way - the better way
    Use the SWIG framework ( http://www.swig.org ). Your code will be very maintenable, you will not have to deal with JNI issues (there are lots and lots of JNI details you will have to bother with, solve all that problems with SWIG). Take care with spelling - SWIG is not SWING.

Maybe you are looking for

  • Powershell shortcut gives"this file does not have a program associated with it for performing this action"

    Hi, We have a server where powershell gives an error. The shortcut or the context menu for start button (replaced cmd in context menu) gives an error saying "this file does not have a program associated with it for performing this action". In some ev

  • Dv6095 motherboard

    I need to replace the motherboard on my dv6095 and this needs a 443774-001  - can anyone tell me if there is difference between this board supplied for the US market compared with one for the UK?    I can obtain one from the US which is an updated ve

  • Google Hangouts 2.0.122

    Google Hangouts is updating with something neat  SMS  Intergration have a look at it through the Google Playstore and here Via Droid life:. b33 http://www.droid-life.com/2013/11/07/google-hangouts-2-0-122-with-sms-integration-rolling-out-to-all/

  • Where do I find the program once it's downloaded

    I've downloaded the PS CC version after subscribing to the program and can't find where to open the program?   Can anyone help?  The only thing on my desktop is the Cloud CC icon which opens up the apps programs to download/update files.

  • Home page Hero Orbit slider suddenly doesn't work

    We're developing this site http://scholzandbarclay.businesscatalyst.com based on the http://uguru-interior-design-us-feb52014.businesscatalyst.com template. After making a few minor changes late yesterday, the hero orbit slider suddenly doesn't work.