Hi, I'd set up my JNA "environment" and successfully run the printf() C Demo code.
Now, I've created a class in MS Studio and built with the setting can be seen in the picture.
Class looks like
class __declspec(dllexport) CMyClass
{
public:
void welcome() { ... Hello world ...};
};
And I want to call this welcome method from Java.
I saw somewhere an example code, but I could find it now. I've found several example for simple C files. But this is different, because I've a .lib too and I don't know whether it has to be used or not.
Thanks for your help!
Tamás
--
You received this message because you are subscribed to a topic in the Google Groups "Java Native Access" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jna-users/YTr7IUOIo5I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jna-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#include <stdio.h>
__declspec(dllexport) void hello()
{
printf("Hello from C");
}
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
public class PaMMTE {
public interface CPaMMTE_testDLL extends Library {
public void hello();
}
public static void main(String[] args) {
CPaMMTE_testDLL lib = (CPaMMTE_testDLL) Native.loadLibrary("TestCallingFromJava", CPaMMTE_testDLL.class);