【转】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 ...
随机推荐
- jQuery 遍历 - siblings() 方法
本文来自:http://www.w3school.com.cn/jquery/traversing_siblings.asp jQuery 遍历参考手册 实例 查找每个 p 元素的所有类名为 &quo ...
- JAVA File类 分析(三)
前面两篇与大家一起研究了unix下的文件系统,本篇将和大家一起分析 文件的属性和文件夹. ok,废话不说,先来段代码 #include <stdio.h> #include <sys ...
- 6T GPT 移动硬盘在linux下的挂载
实验室拿来了一个6T的移动硬盘,拿到后没有分区就直接用了,在Windows上用的好好的,插到上Linux后起初不会挂载,折腾了一会,成功挂载,很简单. 运行fdisk –l后,显示如下: 很明显,sd ...
- 【迪杰斯特拉双关键字最短路】【HDU3790】【最短路径问题】
题目大意: 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的. 只需要再更新的时候判断一下就好 voi ...
- 关于js对象值的传递
结合红宝书和网上的一些文章,记录下自己对关于js对象的值的传递的一些理解. js对象是保存在堆内存中的,当把对象赋值给变量时,是把对象在堆内存的引用(地址)赋值给了变量,变量通过地址来访问对象.下面来 ...
- html网页获取php网页数据等知识记录
所有跟php有关的网页都必须在Apache服务器下打开.需要配置好confg.ini的文件路径. AJAX: 通过事件不断的向服务器发送请求,然后服务器会时时返回最新的数据,这就是AJAX的功能 PS ...
- div滚动与控制
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head&g ...
- HTML——表格与表单
1.表格 <table></table> background:背景图片. 属性 值 描述 align left center right 不赞成使用.请使用样式代替. 规定表 ...
- iOS开发之网络请求(基于AFNetworking的再封装)
最近一直很忙也没有什么时间写博客了.放假了休息一下,就写一篇博客来总结一下最近做项目中出现过的问题吧!!! 首先,在项目中我的起到了什么作用,无非就是把美工(UI设计师)给我们的图显示出来,然后再和服 ...
- 表格(table) 插件:支持当前行增行、删除。使用事件委托
最近做一个项目,需要对表格进行增行和删行. 研究了一下jquery操作dom的方法和事件委托原理,下面是我编写的例子,源码传上,欢迎高手指点. 功能: 支持在指定行下面增行: 支持删行指定行: 增行. ...