0

I have an application that works as DDE client & uses the data it receives to run few animations. This client is installed on Windows server 2012. I need to supply the DDE client application with few variables to run the animations properly.

On the same machine I don't have Microsoft Office installed so I can't use Excel for this job. Any idea how can I create a DDE server that service the required data to the client.

Searching in google has not resulted in clear tutorials on how to implement such this. I have very good programming skills in C/C++. However I need a guideline, recommended APIs, or clear tutorials.

Edit: I need the server & client applications to run on the same machine & same OS.

Thanks

kadora
  • 325
  • 1
  • 5
  • 8

1 Answers1

4

DDE is defined almost entirely in terms of Windows messages, so to create a DDE server, you mostly:

  1. set up a connection in response to a WM_DDE_INITIATE
  2. listen for a WM_DDE_ADVISE or WM_DDE_REQUEST
  3. Respond with a WM_DDE_DATA as appropriate
    • immediately for a WM_DDE_REQUEST
    • as needed for a WM_DDE_ADVISE
  4. Shut down updates in response to a WM_DDE_UNADVISE
  5. Possibly also listen for WM_DDE_POKE messages to accept data from the client (if this makes sense in your case).
  6. Shut down a connection in response to WM_DDE_TERMINATE

Hmm...there's probably at least one other message that doesn't occur to me at the moment, but that probably covers at least 90% of cases (and at least in my experience, even WM_DDE_POKE is fairly unusual).

Since you (apparently) have a single, specific client in mind, you can probably trim that back somewhat. For example, it sounds like you probably don't need/want to support warm linking and such, so you probably don't care about WM_DDE_ADVISE/WM_DDE_UNADVISE. Your server can basically just initiate the connection when it receives WM_DDE_INITIATE, send data when it receives a WM_DDE_REQUEST, and shut down when it receives a WM_DDE_TERMINATE.

Jerry Coffin
  • 476,176
  • 80
  • 629
  • 1,111
  • 1
    I'm accepting this as the correct answer. Eventually I couldn't find a pretty well written tutorial on the subject & how to create a DDE server application. So I had to follow Microsoft DDEML guide page which is honestly not clear enough on the implementation side of the their library. For those who will read this question, you can find information on following site: https://msdn.microsoft.com/en-us/library/windows/desktop/ms648712(v=vs.85).aspx. Don't forget to import windows.h with ddeml.h header files to your code. Good Luck – kadora Jan 20 '17 at 18:14