【转】java jawin api 中文 invoke方法
org.jawin
Class FuncPtr
java.lang.Object
org.jawin.FuncPtr
--------------------------------------------------------------------------------
public final class FuncPtr
extends java.lang.Object
这个是用来调用标准DLL的类
Class
for working with a reference to a single Win32 function exposed in
standard DLL's. The Jawin Userguide - Calling a DLL Entry Point
这个文档可以当作如何使用JAWIN的参考
document should be consulted about how to use this class.
包括了一些常用的函数的调用方法
Contains several invoke_*-methods for some standard function signatures.
可以大概分成一下三种
These falls in three groups:
invoke_I- 一些以INT做为标准返回的本地方法的调用函数
methods for native methods with a standard int as [retval]
invoke_OI-一些最后参数作为[out]返回的本地方法的调用函数
methods for native methods with a last parameter being a [out] int
invoke_S-一些返回数组的本地方法的调用函数(也可以被使用那些返回为STRUCTS的方法)
methods for native methods returning a byte array (can be used for methods returning structs)
Please
notice that because of the TYPEDEF in C/C++ many method signatures are
covered by the relatively few invoke_*-methods, as eg. HWND, HRESULT,
LONG etc. all can be represented as Java int's.
请注意C/C++的返回信息的类型和JAVA不同,但是有一些类型可以用java的一些类型代替
比图 HWND,HRRSULT LONG等等 这些都能被表示成为java的int
If
working with a function that does not match one of the standard
signatures, use the generic invoke(String, int, NakedByteStream,
Object[], ReturnFlags).
如果使用的一些函数不能和标准的调用方法不匹配,请使用标准的调用方法
Version:
版本 1.3
$Revision: 1.3 $
Author:
作者:
Stuart Halloway, http://www.relevancellc.com/halloway/weblog/
Morten Andersen, arosii_moa (at) users.sourceforge.net
See Also:
例子:
The Jawin Userguide - Calling a DLL Entry Point
--------------------------------------------------------------------------------
Constructor Summary构造器描述
FuncPtr(java.lang.String dll, java.lang.String name)
? Method Summary
void close()
Call to "free" the function pointer. 释放函数指针
boolean equals(java.lang.Object o)
protected void finalize()
backup for releasing resources, by calling close().备份被释放的资源
int getPeer()
int hashCode()
int invoke_I(byte[] arg0, ReturnFlags flags)
调用需要一个数组指针作为参数的本地方法,返回整形变量
for calling native methods taking one pointer to a byte array, and returning an int.
int invoke_I(int arg0, int arg1, int arg2, int arg3, ReturnFlags flags)
返回需要四个整形变量作为参数的本 地方法,返回一个整形变量
for calling native methods taking four int args, and returning an int.
int invoke_I(int arg0, int arg1, ReturnFlags flags)
调用以两个整形变量作为参数的本地方法,返回一个整形变量
for calling native methods taking two int args, and returning an int.
int invoke_I(int arg0, ReturnFlags flags)
调用以一个整形变量作为参数的本地方法,返回一个整形变量
for calling native methods taking one int arg, and returning an int.
int invoke_I(int arg0, java.lang.String arg1, ReturnFlags flags)
调用以一个整形变量和以个字符串变量为参数的本地方法,返回一个整形变量
for calling native methods taking one int and one String args, and returning an int.
int invoke_I(int arg0, java.lang.String arg1, java.lang.String arg2, int arg3, ReturnFlags flags)
调用以一个整形变量和两个字符串变量和一个整形变量作为参数的本地方法,返回一个整形变量(使用MessageBoxWDEMO的例子)
for calling native methods taking one int, two String and one int args, and returning an int (used for MessageBoxW).
int invoke_I(ReturnFlags flags)
调用没有变量的本地方法,返回一个整形变量
for calling native methods taking no args, and returning an int.
int invoke_I(java.lang.String arg0, ReturnFlags flags)
调用以一个字符串作为参数的本地方法,返回一个整形变量
for calling native methods taking one String arg, and returning an int.
int invoke_I(java.lang.String arg0, java.lang.String arg1, ReturnFlags flags)
调用以两个字符串变量的本地方法,返回一个整形变量
for calling native methods taking two String args, and returning an int.
int invoke_OI(int arg0, int arg1, int arg2, int arg3, ReturnFlags flags)
调用以五个整形变量,其中前面四个作为[IN]参数,最后一个作为[OUT]变量的本地方法
for calling native methods taking five int args, where the first four
are standard [in] parameters and the last int is a [out] parameter.
int invoke_OI(int arg0, ReturnFlags flags)
调用以两个整形变量,其中最后个整形变量作为[OUT]变量 作为参数的本地方法,
for calling native methods taking two int args, where the last int is a [out] parameter.
int invoke_OI(int arg0, java.lang.String arg1, ReturnFlags flags)
调用以一个整形变量作为[IN]参数,一个字符串类型作为[OUT]参数的本地方法,返回一个整形
for calling native methods taking one [in] int, one [in] String and one [out] int arg.
byte[] invoke_S(byte[] arg0, int arg1, int returnSize, ReturnFlags flags)
调用以一个数组指针一个整形变量作为参数的本地方法,返回一个制定大小的BYTE数组
for calling native methods taking one pointer to a byte array and one
int args, and returning a byte array of a specified size.
byte[] invoke_S(byte[] arg0, int returnSize, ReturnFlags flags)
调用以一个数组指针作为参数的本地方法,返回一个指定大小的byte数组
for calling native methods taking one pointer to a byte array, and returning a byte array of a specified size.
byte[] invoke_S(int arg0, int returnSize, ReturnFlags flags)
调用以一个整形变量作为参数的本地方法,返回一个指定大小的BYTE数组(一般用于返回以个已知大小的STRUCT的情况)
for calling native methods taking one int arg, and returning a byte
array of a specified size (typically used when calling methods returning
a struct with a known byte-size).
byte[] invoke(java.lang.String
instructions, int stackSize, int argStreamSize, byte[] argStream,
java.lang.Object[] objectArgs, ReturnFlags flags)
调用那些不匹配invoke_*调用方法的本地方法
generic method for calling native methods that do not match any of the invoke_* methods.
byte[]
invoke(java.lang.String instructions, int stackSize, NakedByteStream
argStream, java.lang.Object[] objectArgs, ReturnFlags flags)
一种调用使用了NakedByteStream构造输入参数流的invoke(String, int, int, byte[], Object[], ReturnFlags) 的快捷方法
shortcut method for calling invoke(String, int, int, byte[], Object[],
ReturnFlags) when using a NakedByteStream for building the
argStream-bytes.
java.lang.String toString()
Methods inherited from class java.lang.Object这些方法继承了ava.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
?
Constructor Detail
FuncPtr
public FuncPtr(java.lang.String dll,
java.lang.String name)
throws COMExceptionParameters:
参数:
dll - DLL动态库的名称(可以是只有名字的DLL动态库或者是完全地址的名字DLL动态库,注释,文件的后缀不是一定需要的准确的参数语法可以再MSDN文档库里找到
the
name of a DLL (can be either just the name of the DLL or a full path -
use backslashes (\)). Note, that the name is not case sensitive and that
the ".dll"-part is optional. The exact syntax for the parameter can be
found in the MSDN documentation for LoadLibrary.
name - DLL动态库中可被见的本地方法
the function name exposed in the DLL.
Throws:
COMException - 当不能连接到DLL动态库或者找不到方法会发出错误
if unable to load the DLL or find the function.
java.lang.NullPointerException - 当DLL动态库的名字是空会发出的错误
if either dll or name is null.
【转】java jawin api 中文 invoke方法的更多相关文章
- Java Servlet API中文说明文档
Java Servlet API中文说明文档 目 录 1.... Servet资料 1.1 绪言 1.2 谁需要读这份文档 1.3 Java Servlet API的组成 ...
- (转)Java.lang.reflect.Method invoke方法 实例
背景:今天在项目中用到Method 的invoke方法,但是并不理解,查完才知道,原来如此! import java.lang.reflect.Method; /** * Java.lang.refl ...
- Java 反射 Method的invoke回调调用任意方法
Java 反射 Method的invoke回调调用任意方法 @author ixenos 关键子:Method.Field.invoke方法指针/函数指针.回调函数 invoke回调流程示例 0.由C ...
- 深入解析Java反射-invoke方法
博客原文:http://www.sczyh30.com/posts/Java/java-reflection-2/ 上篇文章中回顾了一下Java反射相关的基础内容.这一节我们来深入研究Method类中 ...
- 深入理解Java中的反射机制和使用原理!详细解析invoke方法的执行和使用
反射的概念 反射: Refelection,反射是Java的特征之一,允许运行中的Java程序获取自身信息,并可以操作类或者对象的内部属性 通过反射,可以在运行时获得程序或者程序中的每一个类型的成员活 ...
- JAVA深入研究——Method的Invoke方法。
在写代码的时候,发现Method可以调用子类的对象,但子类即使是改写了的Method,方法名一样,去调用父类的对象也会报错,虽然这是很符合多态的现象,也符合java的动态绑定规范,但还是想弄懂java ...
- JAVA深入研究——Method的Invoke方法
http://www.cnblogs.com/onlywujun/p/3519037.html 在写代码的时候,发现Method可以调用子类的对象,但子类即使是改写了的Method,方法名一样,去调用 ...
- java反射中Method类invoke方法的使用方法
package com.zsw.test; import java.lang.reflect.Method;import java.lang.reflect.InvocationTargetExcep ...
- JAVA深入研究——Method的Invoke方法(转)
在写代码的时候,发现Method可以调用子类的对象,但子类即使是改写了的Method,方法名一样,去调用父类的对象也会报错,虽然这是很符合多态的现象,也符合java的动态绑定规范,但还是想弄懂java ...
随机推荐
- OC基础2:一些基本概念
"OC基础"这个分类的文章是我在自学Stephen G.Kochan的<Objective-C程序设计第6版>过程中的笔记. 1.字符常量是存放在单引号中的单个字符,字 ...
- poj 3026 (最小生成树)
题意:起点开始有超过100个人,总共不会超过100个外星人,问把所有的外星人都搜出来花的最小时间.一条路径上的时间跟人数是无关的,只跟路径长度有关. 思路:刚开始人都在起点,当派一定人数去最近的外星人 ...
- IOS中的几中观察监听模式
本文介绍Objective C中实现观察者模式(也被称为广播者/监听者.发布/注册或者通知)的五种方法以及每种方法的价值所在. 该文章将包括: 1 手动广播者和监听者(Broadcaster and ...
- CSS3无前缀脚本prefixfree.js与Animatable使用
现代浏览器基本支持CSS3,但是一些旧版本的浏览器还是需要添加前缀的.像box-shadow, border-radius这类属性,目前较新版本的浏览器都是不需要前缀的(包括IE9),但是,有些CSS ...
- 读书笔记一 Java程序员的基本修养(数组及其内存管理)
1.1 数组初始化 1.1.1 java数组是静态的 java数组被初始化之后,该数组所占的内存空间.数组长度都是不可变的. java程序中的数组必须经过初始化才可使用. 数组的初始化有两种方式: 1 ...
- C# @字符用法
1.用 @ 符号加在字符串前面表示其中的转义字符“不”被处理. 如果我们写一个文件的路径,例如"D:/文本文件"路径下的text.txt文件,不加@符号的话写法如下: string ...
- SpringMVC(二) —— 中文乱码处理
Get的乱码处理 改tomcat中server.xml中的port=“8080”,加上一个 URIEncoding=”utf-8” 如下图: 2.Post乱码的处理 在web.xml文件中加入 < ...
- 存储过程与SQL的结合使用
--1调用存储过程exec 存储过程名 参数 openrowset方法使用: select * from openrowset('sqlncli', 'server=192.168.247.64;ui ...
- PHP简易计算器方法2
<?php $sum=""; $num1=$_POST['num1']; $num2=$_POST['num2']; if(is_numeric($num1 ...
- php 字符串是否存在
/** * 方法库-字符串是否存在 * @param string $str :字符或字符串 * @param string $string :字符串 * @return string 例子: $st ...