We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Dll given by a third party
Page Index Toggle Pages: 1
Dll given by a third party (Read 583 times)
Dll given by a third party
Feb 5th, 2010, 5:57am
 
Hi everyone,

I was given a dll that exposes several COM functions.
I want to call one of them (using java code) that is called LoginGUI() that returns a string.
the function in the dll is defined as IGlobalVision8API::LoginGUI.


I am trying to use Jnative and processing as I saw on one website.
How could I do that?


Thanks for your feedback.

I am working on a windows environement and i already tried the following:

[i]
import org.xvolks.test.bug.*;
import org.xvolks.jnative.com.utils.*;
import org.xvolks.jnative.misc.registry.*;
import org.xvolks.jnative.com.interfaces.structures.*;
import org.xvolks.test.*;
import org.xvolks.jnative.pointers.*;
import org.xvolks.jnative.com.typebrowser.business.export.*;
import org.xvolks.jnative.exceptions.*;
import org.xvolks.test.windows.*;
import org.xvolks.jnative.logging.*;
import org.xvolks.test.windows.trayicon.*;
import org.xvolks.test.callbacks.linux.*;
import org.xvolks.jnative.com.*;
import org.xvolks.jnative.util.constants.winuser.*;
import org.xvolks.jnative.com.interfaces.*;
import org.xvolks.jnative.util.windows.*;
import org.xvolks.jnative.util.win32session.*;
import org.xvolks.jnative.com.typebrowser.gui.panels.*;
import org.xvolks.jnative.toolkit.*;
import org.xvolks.jnative.util.windows.hotkey.*;
import org.xvolks.jnative.com.typebrowser.business.description.*;
import org.xvolks.jnative.util.mapi.structs.*;
import org.xvolks.jnative.util.mapi.*;
import org.xvolks.jnative.util.windows.structures.*;
import org.xvolks.jnative.util.windows.hooks.*;
import org.xvolks.jnative.*;
import org.xvolks.jnative.pointers.memory.*;
import org.xvolks.jnative.misc.*;
import org.xvolks.jnative.com.typebrowser.gui.*;
import org.xvolks.jnative.com.typebrowser.business.*;
import org.xvolks.jnative.util.ole.*;
import org.xvolks.test.com.*;
import org.xvolks.jnative.misc.machine.*;
import org.xvolks.test.callbacks.*;
import org.xvolks.jnative.util.*;
import org.xvolks.jnative.misc.basicStructures.*;
import org.xvolks.jnative.util.constants.*;
import processing.core.*;

public class Gv8Api //extends PApplet
{
     
public static final String DLL_NAME = "Gv8Api.dll";

 private static JNative nLoginGUI;

 public   String LoginGUI() throws NativeException, IllegalAccessException
 {
   if(nLoginGUI == null)
   {
         nLoginGUI = new JNative(DLL_NAME, "IGlobalVision8API::LoginGUI");  // The actual "decorated" name in the DLL
         nLoginGUI.setRetVal(Type.STRING);  // tell JNative's DLL what kind of return data to expect
   }
    nLoginGUI.invoke();
    return nLoginGUI.getRetVal();
  }
}
Re: Dll given by a third party
Reply #1 - Feb 5th, 2010, 7:43am
 
Just to know, why do you use JNative instead of JNI or, probably better/closer, JNA?
[EDIT] I looked at both. I discovered that unlike what I thought, JNA isn't a product of Sun! So they are at same level, apparently stable. JNA home page doesn't even mention C++ so I don't if it supports this. So, JNative isn't a bad choice in itself, even if apparently it haven't been updated for 2 years (hey, if it is stable...).
Mmm, make that 1 year for the latest download.


Are you sure these are Com functions or are they just "plain" C++ functions? Com is harder to make to work and might need some inits (I believe, I have little experience in the field...).

And since we don't have your DLL, we cannot try your code. You don't tell us what goes wrong.
Page Index Toggle Pages: 1