Questions tagged [jna]

Java Native Access (JNA) provides pure Java access to native shared libraries without the need for additional native or JNI code.

Project website

Resources

1997 questions
0
votes
1 answer

How to distinguish between scrolling up or scrolling down when using jna to listen for mouse events

This is the code that uses jna to listen for mouse events.code detail. I found that the scrolling code for the scroll wheel is 522, but I can't distinguish between up and down scrolling. Can I have a way to distinguish between sliding up and down…
bigding
  • 25
  • 3
0
votes
1 answer

How to write interface for a go function with multi return values with JNA

I'm trying to export some Go functions and call them in Java, with JNA, but I don't know how to define the interface in Java for a Go function with multiple return values. Say the Go function is: //export generateKeys func generateKeys()…
Freewind
  • 193,756
  • 157
  • 432
  • 708
0
votes
1 answer

Fatal error with JNA structure

I have a problem with a very simple example in jna. I would like to read and write in a structure in C with java. I compiled a very simple example in c: typedef struct { int x; } MyStruct; I created the corresponding class in java with…
scenar
  • 1
  • 2
0
votes
1 answer

how to find type of GDI

i am beginner in win 32 api . i try use win 32 api for create an onscreen keyboard . I can give handle of window and components by click but how to realize type of these and i want set text only on text box and editable components i try to use…
Amin Arab
  • 530
  • 4
  • 19
0
votes
1 answer

native library not found in resource path

My application loads a native library (idcomm25.dll file). If I start the application from command prompt with "java -jar myapplication.jar" command, or double clicking on myapplication.jar from explorer, all is fine. If I start the application via…
ugo
  • 284
  • 1
  • 2
  • 10
0
votes
1 answer

How do I pass **C.char data back to caller's buffer?

I am going to build a Go shared object binary (.DLL and .so) that passes back a string to Java. To work out the C string passing from Go I wrote this: package main /* #include */ import "C" import ( "log" "unsafe" ) //export…
Phil
  • 174
  • 3
  • 16
0
votes
1 answer

IntelliJ, JInput and the java.library.path

I'm working on a java project that uses both Jogl and JInput, and I working in IntelliJ. I'm having some issues with the application not being able to find various DLLs. I know the recommended way is to extract the DLLs to a folder and then point…
Delmania
  • 812
  • 10
  • 20
0
votes
0 answers

How to use PJSIP/PJNATH in java?

I am new to PJSIP and i am getting difficulties to use it. I need to use PJNATH for STUN implementation only in my java application. I am using Java Native Acess. I am building so files from pjnath/src/pjnath files. But getting lot of undefined…
Rashed
  • 87
  • 1
  • 12
0
votes
1 answer

JNI / JNA Unsatisfied Link, but symbol is present

i am trying to integrate a legacy system via a provided c-library "libext.so". To test JNA/JNI i want to call the "setProperty" function. objdump libext.so -t | grep setProperty 0000000000104d50 g F .text 000000000000000e…
billdoor
  • 1,999
  • 4
  • 28
  • 54
0
votes
1 answer

jna Native.LoadLibrary does not manage to load library on server (working in local)

I use JNA to load a c++ library (.so) in a java project. I package my library inside the jar, and load it from the jar when instantiating the java class that uses it. I do all this like so: mvn install compiles the c++ code and packages the outcome…
Yvus
  • 338
  • 1
  • 20
0
votes
1 answer

Mapping forBSTR data type in JNA

in header file of DLL I need to wrap is used BSTR data type as I/O parameter. I need to create its mapping in JNA. I have found following example: class BSTR extends PointerType { public BSTR() { } public BSTR(String value) { super(new…
Flasher
  • 1
  • 1
0
votes
0 answers

How to click on "Save" button in IE software download bar using JNA

I have a IE's download bar: I need to find a way to click on one of those buttons or get location of either of "Run", "Save" or "Cancel" I am using Java and JNA, so far code looks like this: import com.sun.jna.Native; import…
Nodir Nasirov
  • 1,488
  • 3
  • 26
  • 44
0
votes
1 answer

Jna, random Invalid Memory Access error

I have an openvr binding which has a minor problem since a while Essentially, from time to time, whenever I free the memory of some geometric 3d model (basestation or controller) I get the Error: "java.lang.Error: Invalid memory access" This is…
elect
  • 6,765
  • 10
  • 53
  • 119
0
votes
0 answers

Java JNA draw/paint on desktop behind icons

I'm trying to paint over an external application's window, in my case more specifically the desktop and behind all visible icons. I figured out after trial and error that you can use: WinDef.HWND desktop = User32.INSTANCE.FindWindow(null,…
Bloc97
  • 274
  • 1
  • 13
0
votes
1 answer

How can I implement a JNA interface to an LPVOID buffer?

I'm trying to implement a JNA interface to VerQueryValue from the Windows API. It has the following native signature: BOOL WINAPI VerQueryValue( __in LPCVOID pBlock, __in LPCTSTR lpSubBlock, __out LPVOID *lplpBuffer, __out PUINT…
etheros
  • 2,733
  • 2
  • 24
  • 25