old DDE knowledge, anyone?

Posted on 2013-10-22
Last Modified: 2013-12-04

I know it's old technology, but I have an app that broadcasts Dynamic Data Exchange (DDE) messages that I need to receive. The app isn't old, but their data communication methodology is.  The problem is I don't know how to receive the messages and because DDE is old, resources are scarce as Google hasn't yielded much.

I've read the brief MS articles, but they're too terse to really gain much.

Can anyone point me to samples of C++ or Visual Basic code that acts as a DDE client? Maybe something I can compile without much change just to see how the communication happens?



p.s. I'm running on Windows 7
Question by:ugeb
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 31

Accepted Solution

Zoppo earned 500 total points
ID: 39593432
Hi ugeb,

I think this is a good and detailed MS article about DDE:

At least it's not brief :o)

LVL 11

Author Comment

ID: 39594898
Thank you.  This is more detailed than what I had found by Googling.  Maybe it was hidden on the 15th page or so.

Do you know about this DDE stuff, or did you just find the link?
LVL 31

Expert Comment

ID: 39596477
Well, I have a bit experience using DDE for opening files in my application i.e. from Explorer, but I didn't yet use it for other communication or data exchange.

But I guess it's pretty much the same, in fact when I double click a file in explorer my application get's send DDE message to retrieve the filename from passed data. Using this I implemented opening files this way even works while a modal dialog is active in my application. To do so I handle WM_DDE_EXECUTE messages to store the passend filename(s) in a list, in an overridden CWinApp::OnIdle (which is only called when no modal dialog is active) I check if the list contains entries and, if so, open the files.

BTW, maybe you could tell us a bit about what your goal is (i.e. you need to communicate with another foreign application which only supports DDE), your prerequisites (i.e. you want to write a new application so it doesn't matter which programming language and/or framework you choose) and what you tried so far?

To Patch or not to Patch? That is the question!

Don't get caught out like thousands of others around the world in the recent Ransomware Fiasco!
- Why it's not a good idea to wait before Patching
- Sensible approaches to Patching discussed
- Add your feedback, comments and suggestions

LVL 11

Author Comment

ID: 39599558
Hi Zoppo,

Thank you for sharing that info with me.

Indeed, I am cornered into using DDE because another app I have uses it to broadcast data.  It's not even an old app, but they use DDE to broadcast values, primarily for Excel.

I do not want to have the overhead of having Excel open and calculating, or interpreting code and generally being slow when lots of values are coming in.  

I'd like to have a DDE client whereby I can collect the data from the app and process it with a more dedicated and optimized app. I'm probably indifferent to the language.  I know Python, Java and VBA decently, so VBA could be useful if I went down the VB route.  I used to know C++, but it's been over 5 years since I last used it.  My preference would be Python and then Java.

I looked at Java POI to read from Excel, but that has the disadvantages of 1) having Excel open, and 2) unreliable updating of cells when reading -- requiring saving of the file.  I've had problems with that.

I've also looked at PyWin32, but there is no documentation or working examples.

Based on a good recommendation someone else just gave me here, I tried an open sources 3rd party dot net DDE client/server library WinWedge:

I managed to compile and run the app in Visual Basic .Net.  So, that's the route I'll pursue if I can't find anything better.
LVL 31

Expert Comment

ID: 39599971
Hi ugeb,

sorry, unfortunately as told I didn't use DDE for such things before.

But, I'm even not sure if it is possible to write your own application to act as a DDE server replacement for Excel because IMO to do so you have to find out how Excel is identified, i.o.w. which atom is sent with WM_DDE_INITIALIZE, and acknowledge that message to tell the DDE client (the other app) your app is the appropriate DDE server.

This IMO will lead to problems since the behavior may differ depending on the fact Excel is running or not, hard to say.

Further (I'm not sure about this, maybe it's not important) if the other app even starts Excel it might get more difficult, depending on the method how Excel is started in this case you would need to somehow redirect it in a way it starts your app instead. In case registration in HKEY_CLASSES_ROOT is used IMO this won't be possible without messing up Excel's registration in a way i.e. double clicking onto a XLS file in Explorer would start your app instead of Excel.

As told, I'm not sure about this becuase I never tried, but I suspect it's at best difficult, maybe impossible, to find a convenient way to replace Excel as DDE server with your own app.

Is reading an XLS file in C a possible option for you? If say maybe you should take a look at libxls ( which is an open source library to read XLS files.

Beside this I have to admit I cannot help you much doing similar with Java, Python or VB. Anyway I think it shouldn't be too difficult to implement reading XLS files with VB.NET, if you plan to do so please tell, I'm quite sure samples can be found in the internet how to do it.

Best regards,

LVL 31

Expert Comment

ID: 39599981
PS: I guess even for Java and Python libraries are available to read into a XLS file ...
LVL 11

Author Closing Comment

ID: 39600755
Okay, thank you for all your thoughts on the subject.  I still have work to do, but I'm closer to getting it done!

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question