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

📄 dlltest.java

📁 java 调用windows的api
💻 JAVA
字号:
/*
 * DllTest.java -
 *
 * This file is part of the Jawin Project: http://jawinproject.sourceforge.net/
 * 
 * Please consult the LICENSE file in the project root directory,
 * or at the project site before using this software.
 */

/* $Id: DllTest.java,v 1.1 2004/06/14 19:24:55 arosii_moa Exp $ */

package org.jawin;

import java.io.File;

import junit.framework.TestCase;

/**
 * DLL test cases. Loads the DLL named 'testdll.dll' in the directory
 * specified in the 'test.dll.dir' property.
 * 
 * @see the cpp testdll project.
 *
 * @version     $Revision: 1.1 $
 * @author      Stuart Halloway, http://www.relevancellc.com/halloway/weblog/
 */
public class DllTest extends TestCase {

	private String testDllDir = System.getProperty("test.dll.dir");
	private String testDll = testDllDir + File.separator + "testdll";

	public void testLifetime() throws Exception {
		FuncPtr fp = new FuncPtr(testDll, "_fnTestdll@0");
		assertTrue(0 == fp.invoke_I(ReturnFlags.CHECK_NONE));
		assertTrue(1 == fp.invoke_I(ReturnFlags.CHECK_NONE));
		fp.close();
		FuncPtr fp2 = new FuncPtr(testDll, "_fnTestdll@0");
		assertTrue(0 == fp2.invoke_I(ReturnFlags.CHECK_NONE));
		fp2.close();
	}
}

⌨️ 快捷键说明

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