#include <stdlib.h>
#include <iostream>
#include <windows.h>
using namespace std;
extern "C"
{
void test() {
MessageBox(NULL, //父窗口
"调用成功", //提示信息
"人生寂寞啊", //标题栏
MB_OK | MB_ICONEXCLAMATION);//按钮和图标
}
#include <iostream>
#include <windows.h>
using namespace std;
extern "C"
{
void test() {
MessageBox(NULL, //父窗口
"调用成功", //提示信息
"人生寂寞啊", //标题栏
MB_OK | MB_ICONEXCLAMATION);//按钮和图标
}
}
import com.sun.jna.Library;
import com.sun.jna.Native;
public class TestJna {
public interface MyLibrary extends Library{
MyLibrary instance=(MyLibrary)Native.loadLibrary("zz",MyLibrary.class);
void test();
}
public static void main(String[] args){
try{
MyLibrary.instance.test();
}catch(Exception e){
e.printStackTrace();
}
}
}