0
votes

I want to use DDE communication with java and java eclipse editor to run some simple code. I imported the called library pretty-tools-JDDE-2.0.3.jar to my project but in vain - DDEClient and other DDE type not recognized. Here is the code :

public class Testdde {
    public static void main(String[] args) {
        DDEClient client;
        Conversation url = null;
        client = DDEClient.getInstance();
        try {
            url = client.connect("Iexplore", "WWW_OpenURL");
        } catch (DDEException e) {
            System.out.println("No running instance of Internet Explorer is found. Stopping.");
            e.printStackTrace();
            client.close();
            return;
        }
        System.out.println("Connected to Internet Explorer");
        System.out.println("Opening \"http://www.java.com/\" in a new window");
        try {
            url.request("http://www.java.com/,,0");
        } catch(DDEException e) {
            e.printStackTrace();
        }
        try {url.close();} catch (Exception ignore) {}
        client.close();
    }
}
3
Are we to understand that you are getting an error message saying " DDEClient and other DDE type not recognized"? If not, what exactly are you getting? And from what? The compiler or the JVM? You haven't provided adequate information here. - user207421

3 Answers

1
votes

I think I had same issue on Windows and Netbeans. You need to copy and paste the .dll file (64 or 32 depending of your OS) into the Java class path (check java class path location in System=> environment variables). my path was: C:\ProgramData\Oracle\Java\javapath and i copied JavaDDEx64.dll.

0
votes

Without any error message it's hard to tell what you are asking, but this sounds like you need to put the jdde jar into the build path.

  1. Right click on the project
  2. Select Build Path / Configure Build Path...
  3. Select the Libraries tab
  4. Select Add Jars... (I am assuming you have the jar in the project already)
  5. Browse to the jar you want to add
  6. Click OK
  7. Click OK

This should make the classes in the jdde jar available both during the development and during the execution.

Further research shows us this: http://jdde.pretty-tools.com/en/examples/unsatisfiedlinkerror.htm

0
votes

Try change DDEClient class to DDEClientConversation