HCONVLIST DdeConnectList(idInst, hszService, hszTopic, hConvList, pCC) | |||||
DWORD idInst; | /* instance identifier | */ | |||
HSZ hszService; | /* handle of service-name string | */ | |||
HSZ hszTopic; | /* handle of topic-name string | */ | |||
HCONVLIST hConvList; | /* handle of conversation list | */ | |||
PCONVCONTEXT pCC; | /* address of structure with context data | */ |
The DdeConnectList function establishes a conversation with all server applications that support the specified service/topic name pair. An application can also use this function to enumerate a list of conversation handles by passing the function an existing conversation handle. During enumeration, the Dynamic Data Exchange Management Library (DDEML) removes the handles of any terminated conversations from the conversation list. The resulting conversation list contains the handles of all conversations currently established that support the specified service name and topic name.
idInst
Specifies the application-instance identifier obtained by a previous call to the DdeInitialize function.
hszService
Identifies the string that specifies the service name of the server application with which a conversation is to be established. If this parameter is NULL, the system will attempt to establish conversations with all available servers that support the specified topic name.
hszTopic
Identifies the string that specifies the name of the topic on which a conversation is to be established. This handle must have been created by a previous call to the DdeCreateStringHandle function. If this parameter is NULL, the system will attempt to establish conversations on all topics supported by the selected server (or servers).
hConvList
Identifies the conversation list to be enumerated. This parameter should be set to NULL if a new conversation list is to be established.
pCC
Points to the CONVCONTEXT structure that contains conversation-context information. If this parameter is NULL, the server receives the default CONVCONTEXT structure during the XTYP_CONNECT or XTYP_WILDCONNECT transaction.
The CONVCONTEXT structure has the following form:
#include <ddeml.h>
typedef struct tagCONVCONTEXT { /* cc */
UINT cb;
UINT wFlags;
UINT wCountryID;
int iCodePage;
DWORD dwLangID;
DWORD dwSecurity;
} CONVCONTEXT;
The return value is the handle of a new conversation list if the function is successful. Otherwise, it is NULL. The handle of the old conversation list is no longer valid.
Use the DdeGetLastError function to retrieve the error value, which may be one of the following:
DMLERR_DLL_NOT_INITIALIZED
DMLERR_INVALID_PARAMETER
DMLERR_NO_CONV_ESTABLISHED
DMLERR_NO_ERROR
DMLERR_SYS_ERROR
An application must free the conversation-list handle returned by this function, regardless of whether any conversation handles within the list are active. To free the handle, an application can call the DdeDisconnectList function.
All members of the default CONVCONTEXT structure are set to zero except cb, which specifies the size of the structure, and iCodePage, which specifies CP_WINANSI (the default code page).
DdeConnect, DdeCreateStringHandle, DdeDisconnect, DdeDisconnectList, DdeInitialize, DdeQueryNextServer