Presentation is loading. Please wait.

Presentation is loading. Please wait.

Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/29.

Similar presentations


Presentation on theme: "Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/29."— Presentation transcript:

1 Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/29

2 Data Exchange Dynadata Copyright, 2014 © DynaData S.A. 2/29

3 Data Exchange Overview
Clipboard Dynamic Data Exchange (DDE) Component Object Model Object Linking and embedding (OLE) Structured Storage Active technologies Automation COM and MFC ATL Dynadata Copyright, 2014 © DynaData S.A. 3/29

4 Clipboard I The most common means of inter application communication is the Clipboard. Dynadata Copyright, 2014 © DynaData S.A. 4/29

5 Clipboard II The process is initiated by the user and has a very simple protocol. When the user requests a cut or copy operation to place data in the Clipboard, the application makes application programming interface (API) calls to empty the Clipboard and then to send data to it. The application provides the single item of data in as many formats as it can, so as to increase the likelihood that the eventual recipient will understand one of them. Dynadata Copyright, 2014 © DynaData S.A. 5/29

6 Dynadata Clipboard III
Possible problems of using huge amounts of system resources in rendering your application's data in many different formats can be avoided by employing the delayed rendering technique. Dynadata Copyright, 2014 © DynaData S.A. 6/29

7 Clipboard IV Using this technique allows the provider of the data to simply list the formats it supports, but only to have to render the data when another application actually tries to take it from the Clipboard. In this way, data that is never going to be used never needs to be rendered. When the user makes a paste request, the receiving application enumerates the formats of the data in the Clipboard and, having found one it likes, takes the data. Dynadata Copyright, 2014 © DynaData S.A. 7/29

8 Clipboard Standard Formats I
It’s possible to transfer objects in one of a number of standard formats through the Clipboard or a private data type specific to an application or set of applications. Dynadata Copyright, 2014 © DynaData S.A. 8/29

9 Clipboard Standard Formats II
It’s possible to transfer objects in one of a number of standard formats through the Clipboard or a private data type specific to an application or set of applications. Dynadata Copyright, 2014 © DynaData S.A. 9/29

10 Clipboard Private Formats
Windows provides a mechanism to register the names of private formats at run time. Publishing the format means creating a document that gives details of the format and describes how it should be used. Dynadata Copyright, 2014 © DynaData S.A. 10/29

11 Dynamic Data Exchange (DDE)
DDE is a protocol that allows two applications to exchange data in a format that they both understand. These two programs are known as the “server” and the “client”. A single Windows program can be both a client to one program and a server to another, but this requires two different DDE conversations. Dynadata Copyright, 2014 © DynaData S.A. 11/29

12 Dynamic Data Exchange (DDE) II
A server can delivery data to multiple clients, and a client can obtain data from multiple servers, but again, this requires multiple DDE conversations. The DDE protocol was originally implemented using a set of Windows messages and the same set of data formats that the Clipboard uses. Dynadata Copyright, 2014 © DynaData S.A. 12/29

13 Dynamic Data Exchange (DDE) III
To keep each conversation the DDE protocol uses a different window. When a client asks a server for data, it must be able to identify the type of data it wants. A program involved in a DDE conversation need not be specially coded to work with each other. Dynadata Copyright, 2014 © DynaData S.A. 13/29

14 Dynamic Data Exchange (DDE) (types of conversation)
Cold Link Hot Link Warm Link Dynadata Copyright, 2014 © DynaData S.A. 14/29

15 Initiating DDE Conversation
A DDE conversation is initiated by the client program. The client broadcast a message (called WM_DDE_INITIATE) to all current running Windows programs. A DDE server that has this data can respond to this broadcast message and the conversation begins. Dynadata Copyright, 2014 © DynaData S.A. 15/29

16 Dynadata The DDE Type of Data
The DDE protocol identifies the units of data passed between the client and server with a three-level hierarchy of application, topic, and item names. Application name (the name of the server application) Topic name (general classification of data within which multiple data items ) Item name (information related to the conversation topic ) Dynadata Copyright, 2014 © DynaData S.A. 16/29

17 Dynadata The DDE Type of Data II
The application name and topic that define a conversation cannot be changed during the course of the conversation. Values for the data item can be passed from the server to the client, or from the client to the server Data can be passed with any of the standard clipboard formats or with a registered clipboard format. A special, registered format named Link identifies an item in a DDE conversation. Dynadata Copyright, 2014 © DynaData S.A. 17/29

18 Dynamic Data Exchange (DDE)
Server application answer diagram Dynadata Copyright, 2014 © DynaData S.A. 18/29

19 The DDE Cold Link I WM_DDE_INITIATE
A Cold Link conversation begins when a client broadcast a WM_DDE_INITIATE message identifying the application and the topic it requires. The application and topic may be NULL to begin a conversation with any server application or any data topic. Dynadata Copyright, 2014 © DynaData S.A. 19/29

20 The DDE Cold Link II WM_DDE_INITIATE
A server that supports the specified topic respond to the client with a WM_DDE_ACK message. Client Server WM_DDE_ACK WM_DDE_INITIATE (application, topic) Dynadata Copyright, 2014 © DynaData S.A. 20/29

21 The DDE Cold Link I WM_DDE_REQUEST
The client then request a particular data item by posting a WM_DDE_REQUEST message. If the server can supply this data item, it responds by posting a WM_DDE_DATA message to the client. WM_DDE_ACK (positive) WM_DDE_REQUEST (item) WM_DDE_DATA Client Server Dynadata Copyright, 2014 © DynaData S.A. 21/29

22 The DDE Cold Link II WM_DDE_REQUEST
The client must acknowledge to the server that it has received the WM_DDE_DATA message if the server asked this acknowledgment in a flag passed with the WM_DDE_DATA message. A flag passed with the WM_DDE_ACK message indicates a "positive" acknowledgment. Dynadata Copyright, 2014 © DynaData S.A. 22/29

23 The DDE Cold Link III WM_DDE_REQUEST
If the client post a WM_DDE_REQUEST message to the server, and the server cannot supply the request data item, then the server post a “negative” WM_DDE_ACK message to the client. WM_DDE_ACK (negative) WM_DDE_REQUEST (item) Client Server The DDE conversation continues with the client for the same data item or different data item... Dynadata Copyright, 2014 © DynaData S.A. 23/29

24 The DDE Cold Link WM_DDE_TERMINATE
The conversation is terminated when the client and server post each other WM_DDE_TERMINATE message. Client Server WM_DDE_TERMINATE WM_DDE_TERMINATE The server can post the first WM_DDE_TERMINATE message and the client must respond to that. Dynadata Copyright, 2014 © DynaData S.A. 24/29

25 Dynamic Data Exchange Management Library (DDEML) I
More recently, the Dynamic Data Exchange Management Library DDEML API set was introduced to provide isolation both from the actual protocol and also from the implementation of the protocol under Windows. Dynadata Copyright, 2014 © DynaData S.A. 25/29

26 Dynamic Data Exchange Management Library (DDEML) II
The DDEML is a dynamic-link library (DLL) that Win32-based applications can use to share data. The DDEML provides functions and messages that simplify the task of adding DDE capability to a Win32-based application. Instead of sending, posting, and processing DDE messages directly, an application uses the DDEML functions to manage DDE conversations. (A DDE conversation is the interaction between client and server applications.) Dynadata Copyright, 2014 © DynaData S.A. 26/29

27 Dynamic Data Exchange Management Library (DDEML) III
Existing applications that use the message-based DDE protocol are fully compatible with those that use the DDEML. That is, an application that uses message-based DDE can establish conversations and perform transactions with applications that use the DDEML. Dynadata Copyright, 2014 © DynaData S.A. 27/29

28 Dynamic Data Exchange Management Library (DDEML) IV
Because of the many advantages of the DDEML, new applications should use it rather than the DDE messages. To use the API elements of the DDEML, you must include the DDEML header file in your source files, link with the DDEML library, and ensure that the DDEML dynamic-link library is in the system's search path. Dynadata Copyright, 2014 © DynaData S.A. 28/29

29 Terminating DDE Conversation
A DDE conversation is initiated by the client program. The client broadcast a message (called WM_DDE_INITIATE) to all current running Windows programs. A DDE server that has this data can respond to this broadcast message and the conversation begins. Dynadata Copyright, 2014 © DynaData S.A. 29/29


Download ppt "Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/29."

Similar presentations


Ads by Google