项目作者: tuddman

项目描述 :
connect to a DDE (dynamic data exchange) server/client ... in Clojure!
高级语言: C++
项目地址: git://github.com/tuddman/clj-dde.git
创建时间: 2013-11-11T04:40:47Z
项目社区:https://github.com/tuddman/clj-dde

开源协议:Eclipse Public License 1.0

下载


clj-dde

A Clojure library (really a wrapper around the Java DDE library provided by pretty_tools) to interoperate with DDE (dynamic data exchange) sources.

Rationale

  1. Sometimes you need to connect to a DDE source, and
  2. would rather do it in Clojure > some other language

Setup

Make sure you have Leiningen installed.

Your project.clj should include something like the following:

  1. (defproject foo "0.1.0"
  2. ...
  3. :dependencies [[org.clojure/clojure "1.5.1"]
  4. [clj-dde "0.2.0"]]
  5. ...)

Usage

Work in Progress.

When you need to connect with a DDE data source…

  1. (def excel-conv (dde/convesation)) ;; to setup a connection.
  2. (dde/connect excel-conv "excel" "sheet1") ;; to connect to a datasource (excel)
  3. (dde/request excel-conv "R1C1") ;; to 'poll' the data contained in cell R1C1

The major difference between version 0.1.x and 0.2.x is that all functions
that previously returned nil now returns the conversation object, thus
making the functions chain-able:

  1. (-> (dde/conversation)
  2. (dde/connect "excel" "sheet1")
  3. (dde/request "R1C1"))

check out the dde-example folder for further examples and usage.

Issues

If you get the message “java.lang.UnsatisfiedLinkError: no JavaDDEx64 (or JavaDDE) in java.library.path” you need to add the javaDDEx64.dll (or javaDDE.dll) file (it’s in /resources) to your classpath directory:

(System/getProperty "java.library.path") to find out where this file needs to go.

License

Copyright © 2013 tuddman

Distributed under the Eclipse Public License; the same as Clojure.

The various included Java files (pretty_tools library) are licensed under their respective licenses.