如何将 Delphi 整数数组传递给 Prism DLL?
我已阅读并成功尝试了 的答案如何将 Delphi 字符串传递给 Prism DLL?,但想知道是否可以使用类似的方法将 Delphi 整数数组(静态或动态)传递给 Prism DLL。
I've read and successfully tried the answer to How can I pass a Delphi string to a Prism DLL?, but wondered if it was possible to use a similar method to pass a Delphi array of integers (static or dynamic) to a Prism DLL.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的(无需编组)是使用 BASE16 或 BASE64 将数组编码为 unicode 字符串并传递一个字符串。
The simpliest (without marshalling) is to encode the array using BASE16 or BASE64 into a unicode string and pass a string.
我没有时间编写完整的工作示例,但以下是适应您在另一个问题中提到的示例的关键事项:
使用缓冲区长度声明类型
并在缓冲区中进行操作记住使用“固定”修改器
...
I don't have time to write a full working example but here are the key things to adapt the example you mention in the other question:
declare a type with your buffer length
and to make operations in the buffer remember to use the "pinned" modifier
...