From Wikipedia, the free encyclopedia
In computing, Dynamic Data Exchange (DDE) is a technology for interprocess communication used in early versions of Microsoft Windows and OS/2. DDE allows programs to manipulate objects provided by other programs, and respond to user actions affecting those objects. DDE was partially superseded by Object Linking and Embedding (OLE), and is currently maintained in Windows systems only for the sake of backward compatibility.
History and architecture
[edit]
Dynamic Data Exchange was first introduced in 1987 with the release of Windows 2.0 as a method of interprocess communication so that one program could communicate with or control another program, somewhat like Sun’s RPC (Remote Procedure Call).[1] At the time, the only method for communication between the operating system and client applications was the «Windows Messaging Layer.» DDE extended this protocol to allow peer-to-peer communication among client applications, via message broadcasts.
Because DDE runs via message broadcasts, it is vulnerable to any window-management code that does not pump messages. This problem was not considered during the design of DDE, because DDE predates pre-emptive multitasking in Microsoft Windows.[2]
Moreover, any code managing a window handle can respond to a DDE broadcast; the initiator of DDE must distinguish between expected and unexpected responses. DDE interlocutors usually express what information they seek in terms of hierarchical string keys. For example, a cell in Microsoft Excel was known to DDE by its «application» name. Each application could further organize information by groups known as «topic» and each topic could serve up individual pieces of data as an «item». For example, if a user wanted to pull a value from Microsoft Excel which was contained in a spreadsheet called «Book1.xls» in the cell in the first row and first column, the application would be «Excel», the topic «Book1.xls» and the item «r1c1». Internal changes in the cell due to Excel actions would then be signaled (in reverse) to the calling application via additional message broadcasts.
Relationship to modern automation technologies
[edit]
The common use of DDE is for custom-developed applications to control off-the-shelf software. For example, a custom in-house application might use DDE to open a Microsoft Excel spreadsheet and fill it with data, by opening a DDE conversation with Excel and sending it DDE commands. This feature has mainly been superseded by the Component Object Model suite of technologies. Microsoft has not used DDE internally since the release of Windows 95.[3] For example, Excel now exposes an extensive OLE Automation object model, which is the recommended method for communicating with Excel. The technique is, however, still in use, particularly for distribution of financial data.[4] Because DDE does not require more operating system components than a conventional Windows GUI program, it is also a [little-used] alternative for programs seeking to minimize their dependencies.
Wonderware developed an extension for DDE called NetDDE that could be used to initiate and maintain the network connections needed for DDE conversations between DDE-aware applications running on different computers in a network and transparently exchange data. A DDE conversation is an interaction between client and server applications. NetDDE could be used along with DDE and the DDE management library (DDEML) in applications.
/Windows/SYSTEM32
DDESHARE.EXE (DDE Share Manager)
NDDEAPIR.EXE (NDDEAPI Server Side)
NDDENB32.DLL (Network DDE NetBIOS Interface)
NETDDE.EXE (Network DDE - DDE Communication)
The NetDDE library files
Microsoft licensed a basic (NetBIOS Frames only) version of the product for inclusion in various versions of Windows from Windows for Workgroups to Windows XP. In addition, Wonderware also sold an enhanced version of NetDDE to their own customers that included support for TCP/IP. The technology is extensively used in the SCADA field. Basic Windows applications using NetDDE are Clipbook Viewer, WinChat and Microsoft Hearts.
NetDDE was still included with Windows Server 2003 and Windows XP Service Pack 2, although it was disabled by default. It has been removed entirely in Windows Vista.[5] However, this will not prevent existing versions of NetDDE from being installed and functioning on later versions of Windows.
- ActiveX
- Component Object Model (COM)
- Distributed Component Object Model (DCOM)
- Microsoft .NET
- Observer pattern
- ^ «Net DDE to DOT NET Remoting». 2006-01-12. Archived from the original on 2010-11-11.
- ^ Chen, Raymond (27 Jun 2005). «Why are there broadcast-based mechanisms in Windows?». The Old New Thing. Archived from the original on 16 Dec 2009.
- ^ Chen, Raymond (26 Feb 2007). «Please feel free to stop using DDE». The Old New Thing. Archived from the original on 15 Mar 2019.
- ^ Joel Spolsky — comment on Fog Creek Software discussion forum
- ^ NetDDE has been removed in Windows Vista.
- Charles Petzold. «Dynamic Data Exchange» in Programming for Windows 95. Microsoft Press.
- MSDN: About Dynamic Data Exchange (DDE)
- NetDDE
- Clojure Bindings for DDE, for use in Clojure or Java Applications
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Sign up
Appearance settings
Как включение, так и выключение компьютера представляет собой поэтапную процедуру, в ходе которой последовательно завершаются сначала пользовательские, а затем и фоновые системные процессы. Если на этом этапе произойдет сбой, система не сможет перейти к следующему шагу. Примером тому является сценарий, при котором появляется сообщение «DDE Server Window. Это приложение не позволяет выключить компьютер» при выключении устройства – неполадка, столкнуться с которой может любой пользователь.
Серьезной ее не назовешь, решается она в большинстве случаев успешно. Как именно, разберем ниже, но перед тем позвольте пару слов о том, что же представляет собой этот самый DDE Server Window.
DDE Server – это технология, позволяющая установленным на одном компьютере приложениям обмениваться друг с другом данными по схеме клиент-сервер. Соответственно, когда в работе технологии происходит сбой, система выдает сообщение – в рассматриваемом примере окно DDE Server Window. Но перейдем к нашим решениям.
Причины проблемы могут быть разные, но наиболее вероятной из них является активность какого-то процесса, который почему-то еще не успел завершиться. Поэтому, выждав минуту, нажмите в окне сообщением кнопку «Все равно выключить». Если при этом появится ошибка explorer.exe «Инструкция обратилась по адресу…», нажмите «Отмена», вернитесь в Windows и перезапустите Проводник из Диспетчера задач, а затем попробуйте завершить работу компьютера в штатном режиме.
Если это не сработает, выполните в окошке Win + R или командной строке команду shutdown /s /f /t 0 – она завершает процессы принудительно.
С той же целью вы можете использовать меню завершения работы ПК, вызываемое нажатием клавиш Alt + F4.
В реестре Windows имеется параметр, позволяющий уменьшить время ожидания завершения системных служб. Если какая-либо служба не завершилась в течение заданного времени, система завершит ее работу принудительно. Откройте редактор реестра командой regedit, перейдите в раздел HKLM\SYSTEM\CurrentControlSet\Control и измените значение параметра WaitToKillServiceTimeout в меньшую сторону, скажем, до 2000 миллисекунд.
Также вам нужно будет создать в разделе реестра HKCU\Control Panel\Desktop DWORD-параметр AutoEndTask и установить в качестве его значения 1. Этот параметр включает принудительное завершение процессов, которые не завершили свою работу в положенное им время.
Предложенные выше решения – основные, приведенные ниже – дополнительные, но и они могут оказаться эффективными.
● Если у вас установлен сторонний антивирус, отключите, а еще лучше удалите его. И поверьте, этот пожиратель ресурсов не особо-то и нужен, а для защиты ПК вполне достаточно штатного Защитника.
● Установите последние обновления Windows или напротив, удалите их, если неполадка появилась после апдейта.
● Проверьте систему на предмет повреждении ее целостности. Напоминаем, сделать это можно средствами PowerShell, выполнив одну за другой команды dism /online /cleanup-image /restorehealth и sfc /scannow.
● Отключите элементы автозагрузки в Диспетчере задач, также вы можете попробовать выполнить так называемую чистую загрузку, то есть перезагрузив компьютер с отключенными сторонними службами в оснастке «Конфигурация системы».
● Отключите функцию быстрого запуска.
● Если на компьютере имеется другой пользователь, переключитесь на него (не забыв выйти из ранее используемой учетной записи) и выключите компьютер. Отсутствие ошибки с определенной долей вероятности укажет на проблемы в профиле пользователя – используйте для выключения ПК альтернативную учетную запись.
Наконец, если ошибка появляется регулярно, при этом ее появление вы интуитивно связываете с установкой программ, драйверов, изменением конфигурации или имевшими место сбоями, откатите систему к точке восстановления, на момент создания которой в работе Windows не возникало проблем. А на этом пока все.
Dynamic Data Exchange is a feature of Windows that allows two programs to share data or send commands directly to each other. DDE can be thought of as a direct conversation between two application programs. In most cases, one application is providing some form of data (either text or graphics) to another application. The application that is the source of the data is called the “server” and the application that is receiving the data is called the “client”. For instance, WinWedge is primarily a DDE Server that “serves” incoming serial data to other programs.
Each data item that a server application can provide has a unique identifier consisting of three parts, a DDE Application Name, a DDE Topic, and a DDE Item Name.
The DDE Application Name is almost always the executable filename for the server application (without the .EXE extension). The DDE Topic typically identifies a group or category of data in the server application and each data item that a server can provide has a unique DDE Item Name. Thus, the Application Name, Topic, and Item Name identify the exact source of the data in a server application that is to be linked. (Similar to a telephone number with the three parts: Area Code, Exchange and Number.)
DDE links are always initiated in the client application. The client initiates a DDE link by broadcasting a message containing a DDE Application Name, A DDE Topic, and optionally a DDE Item to all other applications currently running. If a server application is running that can provide the data, it responds to the “DDE initiate” and the Windows operating system opens a “link” between the two applications. Fortunately, most Windows programs that support DDE insulate the user from the low level details of establishing DDE links and simply allow you to specify the Application Name, Topic, and Item Name for a specific piece of data and the link is then automatically established for you by your application program.
For example, if you enter the formula: =WinWedge|Com1!’Field(1)’ in a cell in an Excel spreadsheet and then press the Enter key, Excel will automatically establish a DDE link between WinWedge and the spreadsheet cell. (Note: WinWedge must be running and activated for COM1 in order for the above link formula to be successful). After the link is established, any data in the text box “Field(1)” in WinWedge window will automatically appear in the “linked” cell in the spreadsheet. Also, whenever the data for Field(1) in the Wedge changes, the contents of the spreadsheet cell will automatically be updated with the new data. It is like having the operating system do an automatic cut & paste from the server to the client whenever the server’s data changes. The formula: =WinWedge|Com1!’Field(1)’ contains the three parts necessary to successfully link to WinWedge: the DDE Application Name (WinWedge), the DDE Topic (Com1) and the specific DDE Item Name ‘Field(1)’.
Either application involved in a DDE conversation can terminate the link. Some applications have menu options that allow you to selectively terminate any open DDE links. Closing either of the linked applications also causes all links between the two programs to be terminated.
DDE also allows a client application to send commands to a server. The types of DDE commands, if any, that a server program can accept will vary depending on the application and should be well documented in the application’s user’s manual along with the DDE Application Name and Topic required by client programs to establish the DDE link to the server’s command processor. WinWedge supports over three dozen DDE commands that allow other applications to control the Wedge or transmit data out a serial port. All of these commands are described in detail in WinWedge users manual or the on-line help.
Table of Contents
- What is Dynamic Data Exchange (DDE)?
- How does DDE differ from other inter-process communication methods?
- What are the basic components required for DDE to function?
- Can you explain the process of setting up a DDE conversation?
- What are some common applications that use DDE?
- How do you initiate a DDE link in Microsoft Excel?
- What are the security risks associated with using DDE?
- How can DDE be used to automate tasks between different software applications?
- What are the limitations of DDE compared to more modern technologies?
- How do you troubleshoot common issues encountered with DDE?
- What programming languages support DDE and how is it implemented in them?
- Can you discuss any advanced techniques for optimizing DDE performance?
- References & Further Reading
What is Dynamic Data Exchange (DDE)?
Dynamic Data Exchange (DDE) is a way for different programs on a computer to share information with each other. It was developed by Microsoft and is used mostly on Windows systems. When two programs use DDE, one program can send data to another program, and if the data changes in the first program, it automatically updates in the second program too. This makes it easier for users to keep information up-to-date across different applications without having to manually copy and paste.
For example, imagine you are working on a spreadsheet in one program and a document in another. If you use DDE, you can link a number from the spreadsheet to the document. When you change the number in the spreadsheet, it will automatically change in the document as well. This feature was very useful in the past, but it is not used as much today because newer technologies like OLE (Object Linking and Embedding) and more recent methods have taken its place. Despite this, some older systems and specific applications still use DDE for their operations.
How does DDE differ from other inter-process communication methods?
Dynamic Data Exchange (DDE) is different from other inter-process communication methods because it focuses on sharing data between programs in real-time. When you use DDE, one program can send information to another, and if that information changes, it updates automatically in both places. This makes DDE good for keeping data in sync across different applications. Other methods, like shared memory or sockets, might not update data automatically and can be more complex to set up for real-time data sharing.
Another way DDE differs is in how it works within the Windows operating system. DDE uses a client-server model where one program (the client) requests data from another program (the server). This is simpler than some other methods, like COM (Component Object Model), which require more setup and programming knowledge. DDE was designed to be easier for everyday users and developers to use, but it’s less flexible and secure compared to newer technologies like OLE (Object Linking and Embedding) and .NET remoting, which offer more advanced features and better security.
Overall, while DDE is straightforward and good for simple data sharing, it has limitations. It’s not as widely used today because newer methods provide better performance, security, and flexibility. However, DDE is still found in some older systems and specific applications where its simplicity and direct data sharing capabilities are still valued.
What are the basic components required for DDE to function?
For Dynamic Data Exchange (DDE) to work, you need two main parts: a client and a server. The client is the program that asks for data, and the server is the program that gives the data. When the client wants some information, it sends a request to the server. The server then shares the requested data with the client. This setup makes it easy for different programs to share information without needing to do a lot of extra work.
Another important part for DDE to work is the use of DDE messages. These messages are like instructions that the client and server send to each other to manage the data exchange. For example, a client might send a message to start a conversation with the server, and the server might send a message back with the data. These messages help keep everything organized and make sure the data stays up-to-date between the two programs.
Can you explain the process of setting up a DDE conversation?
Setting up a DDE conversation involves two programs: one that acts as the client and another that acts as the server. The client is the program that needs information, and the server is the program that has the information. To start the conversation, the client sends a special message to the server asking to connect. This message includes the name of the server program and the topic it wants to talk about, like a specific document or data set. If the server agrees to the conversation, it sends a message back to the client, and they are now connected and ready to share data.
Once the connection is made, the client can ask the server for specific data by sending another message. The server then sends the requested data back to the client. If the data in the server changes, it can automatically send an update to the client, keeping both programs in sync. This back-and-forth of messages and data is what makes up a DDE conversation. It’s like the client and server are having a continuous chat about the data they are sharing.
What are some common applications that use DDE?
Some common applications that use DDE are Microsoft Excel and Microsoft Word. In Excel, you can set up a DDE link to pull in data from another program, like a stock ticker, and have it update automatically in your spreadsheet. This is useful for people who need to keep an eye on changing numbers without having to copy and paste all the time. Word can also use DDE to pull in data from Excel or other sources, making it easy to keep documents up-to-date with the latest information.
Another application that uses DDE is the Windows operating system itself. For example, the Windows Clipboard can use DDE to share data between different programs. When you copy something in one program and paste it into another, DDE might be working behind the scenes to make sure the data gets transferred correctly. This makes the whole process smoother and more automatic for users.
How do you initiate a DDE link in Microsoft Excel?
To start a DDE link in Microsoft Excel, you need to use a special function called DDE. You type this function into a cell where you want the data to show up. The function looks like this: =DDE(server, topic, item)
. Here, «server» is the name of the program that has the data, «topic» is what you want to talk about, and «item» is the specific piece of data you want. For example, if you want to pull in stock prices from a stock ticker program called «StockTicker», you might use =DDE("StockTicker", "Stock Prices", "MSFT")
. This tells Excel to ask the StockTicker program for the current price of Microsoft stock.
Once you enter the DDE function and press Enter, Excel will try to connect to the server program and start getting the data. If everything works right, the data will show up in your cell and update automatically whenever it changes in the server program. This means you can keep an eye on changing numbers without having to copy and paste all the time. Just remember, the server program needs to be running for the DDE link to work properly.
What are the security risks associated with using DDE?
Using Dynamic Data Exchange (DDE) can be risky because it can be used to trick people into running harmful software. Hackers might send you a file that looks safe, but when you open it, it uses DDE to start a hidden conversation with a bad program on your computer. This bad program can then do things like steal your information or damage your files without you knowing it. Because DDE is an older technology, it doesn’t have the same level of security as newer methods, which makes it easier for hackers to use it to attack your computer.
Another problem with DDE is that it can be hard to tell if something bad is happening. Since DDE works behind the scenes, you might not see any warnings or signs that a harmful conversation is going on. This makes it important to be careful with files from people you don’t trust and to keep your computer’s security software up to date. While DDE can be useful for sharing data between programs, the risks mean you should think carefully before using it, especially with files from unknown sources.
How can DDE be used to automate tasks between different software applications?
DDE can help automate tasks by letting different software programs talk to each other and share information automatically. For example, if you have a program that keeps track of your sales and another that makes reports, you can use DDE to make the sales data show up in the report automatically. This means you don’t have to copy and paste the numbers every time they change. Instead, the sales program sends the data to the report program, and whenever the sales numbers update, the report updates too. This saves a lot of time and helps keep everything accurate.
Another way DDE can automate tasks is by triggering actions in one program based on what happens in another. For instance, if you have a program that monitors stock prices and another that sends emails, you can set up DDE so that when a stock price reaches a certain level, the monitoring program tells the email program to send an alert. This way, you get an email without having to check the stock prices all the time. By connecting different programs like this, DDE makes it easier to automate routine tasks and keep everything running smoothly.
What are the limitations of DDE compared to more modern technologies?
DDE is an older way for programs to share information, and it has some problems compared to newer methods. One big issue is that DDE is not as secure. It can be used by bad people to trick you into running harmful software. Also, DDE is not very flexible. It’s hard to change or add new features to DDE because it’s an old technology. This makes it less useful for new kinds of programs that need to do more complex things.
Another limitation is that DDE can be slow and not as reliable as newer technologies. When programs use DDE to share data, it might take longer for the information to update, and sometimes the connection can break. Newer methods like OLE and .NET remoting are faster and more reliable. They also offer more ways for programs to work together, which makes them better for modern software that needs to do a lot of different tasks at the same time.
How do you troubleshoot common issues encountered with DDE?
When you run into problems with DDE, the first thing to check is if both the client and server programs are running. DDE needs both programs to be open and working for the data sharing to happen. If one of them is not running, the DDE link won’t work. Another common issue is making sure the names in the DDE function are correct. If you type the wrong server name, topic, or item, the link won’t connect. Double-check the names and make sure they match exactly what the server program uses.
If the DDE link is set up right but still not working, it might be because of security settings. Some programs have security features that can block DDE conversations. Check the settings in both the client and server programs to see if DDE is allowed. Also, try closing and reopening the programs. Sometimes, restarting can fix small connection problems. If you’re still having trouble, look for any error messages that might give you a clue about what’s going wrong.
What programming languages support DDE and how is it implemented in them?
DDE can be used with several programming languages like Visual Basic, C++, and Python. In Visual Basic, you can use DDE by adding a special control to your program. This control lets you send and receive DDE messages easily. You write code to start a conversation with another program, ask for data, and handle any updates that come back. It’s like setting up a chat between two programs, where one asks for information and the other sends it back.
In C++, you use DDE by calling special functions from the Windows API. You need to write more code than in Visual Basic, but it gives you more control over the DDE conversation. You have to set up the connection, send messages, and handle any data that comes back. It’s a bit harder to do, but good for when you need to make sure everything works just right. In Python, you can use libraries like pywin32
to work with DDE. You write Python code to start a DDE conversation, send requests, and get data back. It’s easier than C++ and good for quickly setting up DDE links in your programs.
Can you discuss any advanced techniques for optimizing DDE performance?
To make DDE work better, one good idea is to use fewer DDE links. Every time you set up a DDE link, it takes some computer power to keep it going. So, if you have a lot of links, it can slow things down. Try to only use DDE for the most important data you need to share. Another trick is to update the data less often. Instead of having the data update every second, you can set it to update every few minutes if that’s good enough for what you’re doing. This can help save computer power and make everything run smoother.
Another way to improve DDE performance is to use a faster computer or more memory. DDE can use a lot of computer resources, especially if you’re sharing a lot of data. A faster computer with more memory can handle DDE conversations better and keep everything running smoothly. Also, make sure the programs you’re using are up to date. Sometimes, new versions of software can work better with DDE and fix problems that might slow things down. By doing these things, you can make DDE work better and get the most out of it.
References & Further Reading
[1]: Microsoft. «Dynamic Data Exchange (DDE) Overview».
[2]: Interactive Brokers. «TWS API v9.72+: DDE for Excel».
[3]: «Algorithmic Trading: Winning Strategies and Their Rationale» by Ernie Chan.
[4]: «Python for Finance: Analyze Big Financial Data» by Yves Hilpisch.
[5]: McKinney, W. (2012). «Python for Data Analysis.» O’Reilly Media.