从 Java 进行 DDE 调用
想知道是否有人有从 Java 进行 DDE 调用的经验和/或示例代码。 我已经使用 stddde 库(DdeInitialize、DdeClientTransaction)中的 win32 调用完成了 DDE,并且可以为此编写一个 JNI 包装器,但我认为从 JNA
我还担心 DDE 调用需要从带有消息泵的线程中进行,并且我不完全确定如何在 Java 中强制执行此操作。
我们要做的调用非常简单(相当于 VBA 的 DDInitiate、DDEExcecute 和 DDETerminate 函数)。
Wondering if anyone has experience and/or sample code for making DDE calls from Java. I've done DDE using win32 calls from the stddde library (DdeInitialize, DdeClientTransaction), and could write a JNI wrapper for this, but I was thinking that it might be nice to do it from JNA
I also have some concerns about the fact that DDE calls need to occur from a thread with message pump, and I'm not entirely certain of how to force that in Java.
The calls we'll be doing are pretty simple (equivalent to VBA's DDInitiate, DDEExcecute and DDETerminate functions).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http://jdde.pretty-tools.com/
http://jdde.pretty-tools.com/
十年前,我使用了 Neva Object Technology 的小型 DDE 包装器。 有效,如果你喜欢这类事情的话。 但是 IIRC,您应该阅读 FAQ(尽管如果您以前使用过 DDE,它所做的事情可能并不那么令人惊讶)。
A decade ago I used Neva Object Technology's little DDE wrapper. Works, if you like that sort of thing. But IIRC, you should read the FAQ (although the things it does probably aren't so surprising if you have used DDE before).
JNA 现在在其 contrib 存储库中有一个 DDE 实现(已编译的类可在 jna-platform 工件中找到):
https://github.com/java-native-access/jna/blob/master/contrib/platform/ src/com/sun/jna/platform/win32/DdemlUtil.java
单元测试包含许多使用示例:
https://github.com/java-native-access/jna/blob/master/contrib /platform/test/com/sun/jna/platform/win32/DdemlUtilTest.java
JNA now has a DDE implementation in its contrib repository (the compiled classes are available in the jna-platform artifact):
https://github.com/java-native-access/jna/blob/master/contrib/platform/src/com/sun/jna/platform/win32/DdemlUtil.java
The unit tests contain many usage examples:
https://github.com/java-native-access/jna/blob/master/contrib/platform/test/com/sun/jna/platform/win32/DdemlUtilTest.java