⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.java

📁 一个开源的组件
💻 JAVA
字号:
package org.xvolks.test.Ldcnlib;

import org.xvolks.jnative.JNative;
import org.xvolks.jnative.Type;
import org.xvolks.jnative.exceptions.NativeException;

public class Test {
	
	public static void main(String[] args) throws NativeException, InterruptedException, IllegalAccessException {
//		System.setProperty("jnative.loadNative", "E:\workspace\JNativeCpp\Win32_Release\libJNativeCpp.dll")
		for(String s : JNative.getDLLFileExports("C:\\Documents and Settings\\Administrateur\\Bureau\\ldcnlib\\Ldcnlib.dll")) {
			System.err.println(s);
		}
		System.load("C:\\Documents and Settings\\Administrateur\\Bureau\\ldcnlib\\Ldcnlib.dll");
		JNative LdcnInit = new JNative("Ldcnlib.dll", "LdcnInit");
		LdcnInit.setRetVal(Type.INT);
		LdcnInit.setParameter(0, "COM1");
		LdcnInit.setParameter(1, 19200);
		LdcnInit.invoke();
		
		System.err.println("LdcnInit returned "+LdcnInit.getRetValAsInt());
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -