org.jawin.COMException: 8000ffff: Invalid ptr null flag(原址:http://osdir.com/ml/windows.devel.jawin/2006-01/msg00013.html)
I now realise my arguments to invoke should be more along the lines of
byte[] result = tApp.invoke("GGGGIGGGG:I:G64", leos.size(), nbs, null,
ReturnFlags.CHECK_NONE);
Though I know this is 100% correct! Once again, the parameters
to this method are as follows:
> ---snip---
> INT WINAPI CreateTrustedAppObject(
> char *szDomainPath,
> char *szAppName,
> char *szAppDesc,
> char *szTCPAddress,
> WORD uwTCPPort,
> BOOL bSSLRequired,
> BOOL bRequiresQueueing,
> BOOL bMessageRetention,
> BOOL bOverwrite,
> char *szTrustedAppKey);
> ---snip---
szTrustedAppKey
(OUT) Points to the unique access key assigned to the trusted
application. Returns a 64 byte key plus null.
I have noticed discussion around using win32Invoke. When I
attempt to use this method (along the lines of how others have
described) I receive the following:
---snip---
The method win32Invoke(int, String, int, int, byte[], Object[],
ReturnFlags) in the type GenericStub is not applicable for the arguments
(int, String, int, int, byte[], null)
---snip---
Thanks again!
Adam Bradley
Adam Bradley wrote:
Hi all,
Dipping my toe into COM/DLL type things and I was trying to write a
jawin wrapper to call a DLL function. The method I want to use is well
documented but I keep receiving the following error!?
Anyone have any ideas - thanks in advance!
Adam
---snip---
org.jawin.COMException: 8000ffff: Invalid ptr null flag
at org.jawin.marshal.GenericStub.win32Invoke0(Native Method)
at org.jawin.marshal.GenericStub.win32Invoke(GenericStub.java:152)
at org.jawin.FuncPtr.invoke(FuncPtr.java:186)
at org.jawin.FuncPtr.invoke(FuncPtr.java:205)
at tApp.main(tApp.java:51)
---snip---
The method in question is as follows
---snip---
INT WINAPI CreateTrustedAppObject(
char *szDomainPath,
char *szAppName,
char *szAppDesc,
char *szTCPAddress,
WORD uwTCPPort,
BOOL bSSLRequired,
BOOL bRequiresQueueing,
BOOL bMessageRetention,
BOOL bOverwrite,
char *szTrustedAppKey);
---snip---
And the application
---snip---
import org.jawin.COMException;
import org.jawin.FuncPtr;
import org.jawin.ReturnFlags;
import org.jawin.COMException;
import org.jawin.FuncPtr;
import org.jawin.ReturnFlags;
import org.jawin.io.LittleEndianOutputStream;
import org.jawin.io.NakedByteStream;
import java.io.PrintStream;
import java.io.OutputStream;
import java.io.*; public class tApp { public static void main(String[] args) throws Exception { String szDomainPath = "c:/wpdomain.db"; // 4 [in] char*
String szAppName = "newapp"; // 4 [in] 8
String szAppDesc = "newapp description";// 4 [in] 12
String szTCPAddress = "localhost"; // 4 [in] 16
long uwTCPPort = 1; // 8 [in] 24
String bSSLRequired = "FALSE"; // 4 [in] 28
String bRequiresQueueing = "FALSE"; // 4 [in] 32
String bMessageRetention = "FALSE"; // 4 [in] 36
String bOverwrite = "TRUE"; // 4 [in] 40
String szTrustedAppKey = ""; // 4 [out]44 FuncPtr tApp = null;
try {
tApp = new FuncPtr("GWTApp.dll",CreateTrustedAppObject"); // create a NakedByteStream for the serialization of Java variables
NakedByteStream nbs = new NakedByteStream(); // wrap it in a LittleEndianOutputStream
LittleEndianOutputStream leos = new LittleEndianOutputStream(nbs); leos.writeStringUnicode(szDomainPath);
leos.writeStringUnicode(szAppName);
leos.writeStringUnicode(szAppDesc);
leos.writeStringUnicode(szTCPAddress);
leos.writeDouble(uwTCPPort);
leos.writeStringUnicode(bSSLRequired);
leos.writeStringUnicode(bRequiresQueueing);
leos.writeStringUnicode(bMessageRetention);
leos.writeStringUnicode(bOverwrite);
leos.writeStringUnicode(szTrustedAppKey); byte[] result = tApp.invoke("IGGI:I:", 44, nbs, null,
ReturnFlags.CHECK_NONE); } catch (COMException e) {
System.out.println(e.getMessage().toString());
System.out.println(e.getClass().toString()); PrintWriter out = null;
try {
out = new PrintWriter(new FileWriter("c:\\tApp.log"));
e.printStackTrace(out);
} catch (IOException a) {
System.err.println("Caught IOException: " + a.getMessage());
} finally {
if (out != null) {
System.out.println("Closing PrintWriter");
out.close();
} else {
System.out.println("PrintWriter not open");
}
}
// handle exception
} finally {
if (tApp != null) {
try {
tApp.close();
} catch (COMException e) {
// handle fatal exception
}
}
}
}
}
org.jawin.COMException: 8000ffff: Invalid ptr null flag(原址:http://osdir.com/ml/windows.devel.jawin/2006-01/msg00013.html)的更多相关文章
- VS2008,System.Runtime.InteropServices.COMException (0x800401F3): Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))
在VS2008环境中编译调试运行不报错,但在发布的exe文件运行就报错 System.Runtime.InteropServices.COMException (0x800401F3): Invali ...
- 【转】java jawin api 中文 invoke方法
org.jawin Class FuncPtr java.lang.Object org.jawin.FuncPtr ----------------------------------------- ...
- C语言扩展动态内存报错:realloc(): invalid next size: 0x0000000002365010 ***
晚上被这个内存扩展崩溃的问题折腾的有点崩溃,当答案揭晓的那一刻,恍然大悟,原来如此简单. 练习题目:输入一个字符串,根据字母进行排序,说白了就是一个简单的冒泡 #include <stdio.h ...
- NULL指针 Void* 和野指针
在C和C++的语言中常常有这几个概念: NULL指针.空指针.Void *指针.野指针(Wild Pointer)甚至垂悬指针(Dangling Pointer). 1.NULL指针,一般用于指向一个 ...
- Null指针
C++ Null 指针 C++ 指针 C++ 指针 在变量声明的时候,如果没有确切的地址可以赋值,为指针变量赋一个 NULL 值是一个良好的编程习惯.赋为 NULL 值的指针被称为空指针. NULL ...
- linq查询数值为null的问题以及数据表的关联计算问题
说明:下面实例都是我进行项目开发时的真实部分代码,毫无保留 一.数据表的关联计算 //把当前年度的分差计算出来,建立两个关联的数据表 try { using(TransactionScope scop ...
- 关于空指针NULL、野指针、通用指针 (转)
reference:https://www.cnblogs.com/losesea/archive/2012/11/16/2772590.html 首先说一下什么是指针,只要明白了指针的含义,你就明白 ...
- A pointer is a variable whose value is the address of another variable 指针 null pointer 空指针 内存地址0 空指针检验
小结: 1.指针的实际值为代表内存地址的16进制数: 2.不同指针的区别是他们指向的变量.常量的类型: https://www.tutorialspoint.com/cprogramming/c_po ...
- Java判断对象是否为NULL
Java使用反射判断对象是否为NULL 判断Java对象是否为null可以有两层含义: 第一层: 直接使用 object == null 去判断,对象为null的时候返回true,不为null的时候 ...
随机推荐
- [置顶] Firefox OS 学习——简单了解知识
什么是Firefox OS ? Firefox OS 是一个为网页设计而生的能编译和独立的手机网页操作系统,我们相信在接下来的时代,网页应用将充满整个新兴操作设备,这也为当前许多网页开发者不需要太多的 ...
- 【c语言】调整数组使奇数所有都位于偶数前面
// 调整数组使奇数全部都位于偶数前面 // 输入一个整数数组,实现一个函数,来调整该数组中数字的顺序使得数组中全部的奇数位于数组的前半部分, // 全部偶数位于数组的后半部分. #include & ...
- TreeView(C#)无限目录树代码片段
#region 绑定客户树 protected void bindTreeView() { TreeView1.Nodes.Clear(); string userid = Session[" ...
- UVa 821 Page Hopping
题意: 给出一个有向图,求所有路径(两点间的最短路径)的平均值. 分析: 用floyd求两点间的最短距离,然后求平均就好. 代码: #include <iostream>#include ...
- UVA 12166 Equilibrium Mobile
题意: 给出数个天平,每个天平的结构都类似于二叉树,只有左右重量都相等时才平衡,求每个天平最少改多少个秤砣,也就是叶子结点可以使得整个天平平衡.天平的深度不超过16. 分析: 要使得改动的数量最少,那 ...
- mac 桌面美化
官网:Übersicht 先来大图: 当然,,,我自己的这个还不成型,去官网看看吧,有大神们做好的各种主题可选哦~ 像这样1: 这样2: 甚至这样3:(酷毙了有木有..) Downlo ...
- 关于C#重写,隐藏的一些事
第一次开始写技术博客,不知该从何处下手,本人算是菜鸟一枚,每每看到博客园里面的大牛们分享的技术文章,只能望其项背,高不可攀.但细细想来,若不尝试着从小处从低处慢慢去积累分享,想要成为技术大牛也只能沦为 ...
- Cordova了解
概述 Cordova让我们可以使用HTML.JS以及CSS开发跨平台App的公共部分(整个App就是一个WebView或者或者嵌入到本地组件中),与原生API的交互通过Cordova插件实现. 安装配 ...
- python正则表达式练习篇
练习一: 利用who命令输出所有已经登录系统的用户的信息,并把登录名.用户登录时的电传.登录时间.登录地址利用正则表达式分割开来. 数据的格式: %who wesc console Jun 20 20 ...
- NodeJS学习笔记(一)——搭建开发框架Express,实现Web网站登录验证
JS是脚本语言,脚本语言都需要一个解析器才能运行.对于写在HTML页面里的JS,浏览器充当了解析器的角色.而对于需要独立运行的JS,NodeJS就是一个解析器.每一种解析器都是一个运行环境,不但允许J ...