JNA 的 char** 问题(在 dll 中)

发布于 2024-08-23 05:26:55 字数 251 浏览 6 评论 0原文

好的,使用 jna 制作 jna 包装解决方案来映射 dll 中的导出函数是“容易”的:

long f1(int x), just int
long f2(char* y), just char[]

但是如何处理 long f3(char** z)

我需要 f3 的结果(长)以及 java 端的 z 值。

请不要说应该重写 cpp 代码来避免这种情况:-)

ok it is 'easy' to make jna wrapper solution for mapping exported functions within dll using jna:

long f1(int x), just int
long f2(char* y), just char[]

but how to deal with long f3(char** z) ?

I need f3's result(long) as well as z value on java side.

Please don't say cpp code should be rewritten to avoid this:-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云朵有点甜 2024-08-30 05:26:55

这是一个“指向字符指针的指针”(类似于 BSTR)。您可能必须 导出您的来自 com.sun.jna.PointerType 的自己的类

This is a "pointer to a character pointer" (similar to a BSTR). You may have to derive your own class from com.sun.jna.PointerType

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文