Dynamic Data Exchange in java to link to windows application

Discussion in 'Java' started by AMI, Dec 7, 2004.

  1. AMI

    AMI Guest

    Hi,
    I'm trying to use DDE (Dynamic Data Exchange) to establish a link with
    some Windows program using JAVA code. I use Classes provided by NEVA:
    http://www.nevaobject.com/_docs/_javadde/JavaDde.pdf . I'm using j2SE
    and eclipse IDE.
    Basically, the example that was provided in the documentation with the
    library was accessing an excel sheet , I checked it and it works fine.
    But when I try to connect to the application that I want to link to,
    it gives a windows error and terminates and my code gives an error
    "Execution failure: DdeConnect doesn't return (see MS Q136218)"
    Well, I checked for this error and the soln that I found was to add a
    message loop to the thread that created the window, I donnu what does
    this mean or how I can do it. So would someone help me with this?
    Thanks,
    Iman.

    This is the bug description as I found::

    SYMPTOMS
    A 32-bit application calls DdeConnect when all previous DDEML
    initialization has been performed. DdeConnect never returns.

    CAUSE
    Any thread that creates a top-level window and doesn't have a message
    loop will cause DdeConnect to block. This is because DdeConnect calls
    SendMessage(HWND_BROADCAST...). In this call, SendMessage will put the
    message in the target thread's message queue and block the calling
    thread. If the target thread doesn't have a message loop, it will never
    process this message and therefore never return.

    One complication is that some things create windows without the
    knowledge of the calling thread. It is known that some SQL, RPC, and
    DDEML function calls will do this. Any top-level window that is created
    by a thread that has no message loop will cause this to happen.

    RESOLUTION
    The only current solution is to add a message loop to the thread that
    created the window.
    AMI, Dec 7, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    798
    Kevin Spencer
    May 17, 2005
  2. Rubio
    Replies:
    1
    Views:
    591
    Oliver Wong
    Jan 11, 2006
  3. www.westerncartooncards.ca

    Exchange Links < Western Cartoon Cards > Exchange Links

    www.westerncartooncards.ca, Jul 12, 2004, in forum: HTML
    Replies:
    2
    Views:
    1,219
    Toby Inkster
    Jul 12, 2004
  4. Nemisis
    Replies:
    0
    Views:
    315
    Nemisis
    Apr 16, 2008
  5. Alessandro Barracco

    matrix: exchange rows + exchange columns

    Alessandro Barracco, Jan 25, 2011, in forum: Ruby
    Replies:
    0
    Views:
    150
    Alessandro Barracco
    Jan 25, 2011
Loading...

Share This Page