Windows Application to Windows Application

In a native Windows 3.0 environment, a Windows application (client) will broadcast a DDE Initiate message. Windows serially posts a message to every Windows application currently running and then awaits a reply. As described above, the Initiate Conversation message contains the DDE topic to which any Windows application can respond. The client application continues execution when all other applications have serviced the message. At this time, the client application communicates directly with the server applications, as opposed to the initial broadcast message.

OS/2 Version 2.0 provides two applications to support communications between VDMs, without altering the Windows code:

  • A resident Windows application referred to as the DDE ServerAgent (SA)

  • A DOS protected mode application referred to as the DDEServer (VDMSRVR.EXE).
    ServerAgent

    The Windows VDM's resident ServerAgent consists of two parts:

  • A "ServerAgent" which sends and receives messages outside of the VDM

  • One or more "agents" (each agent is a child window of the ServerAgent), which act as "clones" of applications running in other VDMs.

    If either the DDEServer or the VDM's ServerAgent is not executing, DDE is not available outside of the VDM. The ServerAgent is automatically started when the Windows VDM is started. When started, DDE is in public mode. To keep it local, simply kill (close) the DDE Interchange Agent. To make it public again, simply start the Interchange Agent once more.

    Should the user choose to kill the DDE Interchange Agent, an information message will be displayed indicating that DDE activity will be visible only to the Windows applications executing in the current VDM, discontinuing DDE communication with Presentation Manager applications and other Windows applications.

    The ServerAgent is responsible for all routing of DDE messages, including broadcast messages beyond the confines of the VDM to the DDEServer. The ServerAgent communicates with the DDEServer (VDMSRVR.EXE) via named pipes.

    Agent applications communicate with Windows applications in their VDM and the ServerAgent executing in their VDM. Only the ServerAgent uses named pipes. Agents send requests to the ServerAgent to be forwarded outside of the VDM.

    DDEServer (VDMSRVR.EXE)

    The DDEServer is responsible for routing requests from ServerAgents to the appropriate VDMs. The DDE process is schematically represented in Figure "DDE Process between Windows Environments".

    The sequence of events for DDE communication between applications running in different WIN-OS/2 VDMs is as follows:

  • A DDE Initiate message is broadcast from Windows application A.

  • The message is forwarded by the ServerAgent to the DDEServer.

  • The DDEServer forwards this message to all other DDEAgents.

  • Each DDEAgent broadcasts this initiate message to all Windows applications in their VDM.

  • Windows application D responds affirmatively to this DDE initiate message.

  • The DDEAgent creates a child task ServerAgent A to act as an agent to Windows application A.

  • The DDEAgent forwards an acknowledgement to the DDEServer.

  • The DDEServer forwards this acknowledgement to the DDEAgent for the Windows application A.

  • This DDEAgent creates a child task ServerAgent D to act as an agent to Windows application D.

    10.

    From here on, the two Windows applications communicate through this established path.

    Appl. A <-> DDEChildAgent D <-> DDEAgent A <-> DDEServer <-> DDEAgent D <-> DDEChildAgent A <-> Appl. D.

    This mechanism isolates all named pipe transactions (Steps 2, 3, 7 and 8) to the DDEAgents and the DDEServer. It also gives the Windows application A the illusion of a point-to-point connection to Windows application D (because it will actually communicate with Windows application D's child agent in the same VDM).

    The interprocess communication protocol used between the Windows applications and the DDEAgents is the original and unmodified DDE protocol.

    If two Windows applications require significant amounts of DDE, these applications should be executed from within the same MAVDM. In such instances, the ServerAgent and DDEServer applications would not be required, thereby improving performance and usability. Once this is done, the user need only kill (close) the participating DDE Interchange Agent to ensure that all DDE messaging is kept local.


    [Back: DDE Concepts]
    [Next: Windows Application to Presentation Manager Application]