i'm using jna to glue fortran and java together, and it works great.
except for one thing.
i have two jvm processes, each of which uses the same shared library. individually, they work fine. calling one, and then the other, also works. but then calling the first one again, segv's. the code doesn't do anything interesting; it copies...
I have a pointer in a struct. And I passed a struct pointer to this pointer.
But I could not type cast back to this pointer to struct.
public class Test
{
//
Pointer ptr = new Memory(4);
}
public class Temp extends Structure
{
//
}
Test tst = new Test();
Temp tmp = new Temp();
tst.ptr = tmp.getPointer();
...
Temp...
I am trying to call the C function sane_get_devices from Java using JNA
SANE_Status sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only);
Where SANE_Status is an int and SANE_Device is a structure.
typedef struct
{
SANE_String_Const name; /* unique device name */
SANE_String_Const vendor; /* device vend...
Can any one provide me with a working example of JNA mouse hook, which would be able to track mouse movements/click outside my Java Swing application ?
Thanks in Advance
...
I'm not experiences with Windows API at all, so please excuse my ignorance.
I want to delete files to the trash. How to do that using JNA and how to detect if this would not be possible, e.g., because the files are located on a network share?
...
Which of the following (or other) method would you recommend for accessing a C++ shared library from Java and why?
JNI: I hear this has a number of pitfalls and is quite the undertaking?
SWIG: Apparently this makes using JNI easier, but I've heard it has some problems too?
JNA: I could write a C interface and then use JNA with it i...
I recently downloaded the Java JNA from https://jna.dev.java.net/servlets/ProjectDocumentList?folderID=7408&expandFolder=7408&folderID=0 and tried using it. However, as exemplified by the screenshot below, the demo source code provided in https://jna.dev.java.net/ won't compile, no matter where I place the files. Mind you, I've t...
How do i use JNA with a linked list on Solaris
...
I have a C struct like this:
struct HFSUniStr255 {
UInt16 length;
UniChar unicode[255];
};
I have mapped this in the expected way:
public class HFSUniStr255 extends Structure
{
public UInt16 length; // UInt16 is just an IntegerType with length 2 for convenience.
public /*UniChar*/ char[] unicode = new char[255];
...
I'm having problems using the DWM functionality of Windows Vista/7 on Java windows. I want to make the background of my frame use the Aero style. The Windows API to do so is provide by the function DwmExtendFrameIntoClientArea in the dwmapi library. I've managed to call the procedure properly via JNA, and it does what it is supposed to d...
I'm a Java developer, so please excuse my ignorance.
I want to create a shortcut to an executable, e.g., in the user's autostart or send-to folder (I don't want an installer to do that, because the installer usually is run by an administrator). What API (C preferred) I could use for that task (maybe using JNA)? Thanks in advance.
...
Hi,
I have been busy creating a screen capture function in Java using JNA (java native access).
So far I have been able to do a lot, but I am baffled about some things a bit. The OS is Windows, if you wonder....
I find it easy to capture, for example, a region, or a window, but find it hard to draw over it. The reason for this is the...
What is the Java type for *short using JNA
I have in my dll short and *short, so how can I call
short -> int
*short -> int[]?
Thanks,
Alex
...
Hi,
I have spent some time trying to create a child window of an existing window by using the following piece of code on JNA (Java Native Access) but I guess it is pretty much the same with every other programming language trying to use Windows API.
Here is my declaration of CreateWindowsExA :
public int CreateWindowExA(int i, Strin...
Good day,
I have been using JNA for a while to interact with the Windows API and now I am stuck when creating a window. As far as I have done the following:
1. Have created a child window of an existing window and obtained a valid handler to it.
2. Understood that every window in Windows has a non-stop message-dispatch loop.
3. Understo...
Hi, I have been trying to do the following thing in windows, using JNA: add a button to a window that I haven't created. First, however, I would like to create a WNDPROC listener so I know what messages are being sent.
The problem is that messages are not being sent/received in the message pump, while they should be (because windows co...