Jump to content

WinDdeRespond

From EDM2

This function is issued by a server application to indicate that it can support a dynamic data exchange conversation on a particular topic with a national language conversation context.

Syntax

WinDdeRespond(hwndClient, hwndServer, pszAppName, pszTopicName, pContext)

Parameters

hwndClient (HWND) - input
Client's window handle.
hwndServer (HWND) - input
Server's window handle.
If a server application is responding for more than one topic, it must use a different window for each topic.
pszAppName (PSZ) - input
Application name.
This is the name of the responding server application. It must not be a zero-length string or null.
Application names may not contain slashes or backslashes.
pszTopicName (PSZ) - input
Topic name.
This is the name of the topic which the server is willing to support. It must not be a zero-length string or null.
pContext (PCONVCONTEXT) - input
Conversation context.

Returns

mresReply (MRESULT) - returns
Message return data.

Remarks

This function is issued by a server application after receiving a WM_DDE_INITIATE message that identifies this server application (or indicates that any application can respond), and also either identifies a particular topic which the server can support, or asks for all supported topics (see WinDdeInitiate). This function sends a WM_DDE_INITIATEACK message back to the client, that is the sender of the WM_DDE_INITIATE message.

If the server application can respond, it issues this function once if a specific topic was requested, or once for each topic which it can support, if all supported topics were requested.

A DDE conversation is initiated each time this function is successfully issued. The client is expected to terminate all unwanted conversations. Once a conversation is initiated, it is controlled by the client issuing WinDdePostMsg functions.

To support DDE conversations between applications running in different memory models (16-bit and 32-bit) it is necessary to process all DDE messages in the application window procedure. The use of the WinDispatchMsg function ensures that conversion is performed on memory or segment addresses.

Example Code

This example uses WinDdeRespond to respond to an initiate message (WM_DDEINITIATE) generated by the client window issuing WinDdeInitiate. Here, the server responds as a DDE Server that supports a System topic.

#define INCL_WINDDE             /* Window DDE Functions         */
#include <os2.h>

HWND  hwndClient;       /* client window                        */
HWND  hwndServer;       /* server window                        */
char  pszAppName[15]="DDE Server"; /* server application        */
char  pszTopicName[15]=SZDDESYS_TOPIC; /* topic ('System')      */
MRESULT  mresReply;     /* message return data                  */
CONVCONTEXT Context;
case WM_DDE_INITIATE:
     mresReply = WinDdeRespond(hwndClient, hwndServer, pszAppName,
                               pszTopicName, &Context);

Definition

#define INCL_WINDDE /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HWND            hwndClient;    /*  Client's window handle. */
HWND            hwndServer;    /*  Server's window handle. */
PSZ             pszAppName;    /*  Application name. */
PSZ             pszTopicName;  /*  Topic name. */
PCONVCONTEXT    pContext;      /*  Conversation context. */
MRESULT         mresReply;     /*  Message return data. */

mresReply = WinDdeRespond(hwndClient, hwndServer, pszAppName, pszTopicName, pContext);

Related Functions

Related Messages

  • WM_DDE_INITIATE
  • WM_DDE_INITIATEACK