BridJ - Pointer.pointerToAddress(long peer) 已被弃用
BridJ - Pointer.pointerToAddress(long peer) has been deprecated
从 Maven(版本 0.7.0)下载了一个名为 TaskbarListDemo.java in BridJ repo on GitHub. When I try to compile in Netbeans with the .jar library 的示例,此示例中第 100 行中使用的方法 Pointer.pointerToAddress(long peer)
已弃用。
在这种情况下,正确的使用方法是什么? The docs 对此没有任何解释。有以下可用选项(未标记为已弃用):
public static <P> Pointer<P> pointerToAddress(long peer, PointerIO<P> io)
public static <P> Pointer<P> pointerToAddress(long peer, Class<P> targetClass, Pointer.Releaser releaser)
public static <P> Pointer<P> pointerToAddress(long peer, Type targetType, Pointer.Releaser releaser)
public static Pointer<?> pointerToAddress(long peer, long size, Pointer.Releaser releaser)
public static <P> Pointer<P> pointerToAddress(long peer, long size, PointerIO<P> io, Pointer.Releaser releaser)
非常感谢!
免责声明:我真的不知道这个解决方案是否漂亮,但它有效并且解决了 "deprecated" 问题:
Releaser nopReleaser = new Releaser() {
@Override
public void release(Pointer<?> pointer) {
// NOP
}
};
hwnd = Pointer.pointerToAddress(hwndVal, Integer.class, nopReleaser);
从 Maven(版本 0.7.0)下载了一个名为 TaskbarListDemo.java in BridJ repo on GitHub. When I try to compile in Netbeans with the .jar library 的示例,此示例中第 100 行中使用的方法 Pointer.pointerToAddress(long peer)
已弃用。
在这种情况下,正确的使用方法是什么? The docs 对此没有任何解释。有以下可用选项(未标记为已弃用):
public static <P> Pointer<P> pointerToAddress(long peer, PointerIO<P> io)
public static <P> Pointer<P> pointerToAddress(long peer, Class<P> targetClass, Pointer.Releaser releaser)
public static <P> Pointer<P> pointerToAddress(long peer, Type targetType, Pointer.Releaser releaser)
public static Pointer<?> pointerToAddress(long peer, long size, Pointer.Releaser releaser)
public static <P> Pointer<P> pointerToAddress(long peer, long size, PointerIO<P> io, Pointer.Releaser releaser)
非常感谢!
免责声明:我真的不知道这个解决方案是否漂亮,但它有效并且解决了 "deprecated" 问题:
Releaser nopReleaser = new Releaser() {
@Override
public void release(Pointer<?> pointer) {
// NOP
}
};
hwnd = Pointer.pointerToAddress(hwndVal, Integer.class, nopReleaser);