DdeConnectList function

Establishes a conversation with all server applications that support the specified service name and topic name pair. An application can also use this function to obtain a list of conversation handles by passing the function an existing conversation handle. The Dynamic Data Exchange Management Library removes the handles of any terminated conversations from the conversation list. The resulting conversation list contains the handles of all currently established conversations that support the specified service name and topic name.

Syntax

HCONVLIST DdeConnectList(
  DWORD        idInst,
  HSZ          hszService,
  HSZ          hszTopic,
  HCONVLIST    hConvList,
  PCONVCONTEXT pCC
);

Parameters

idInst

Type: DWORD

The application instance identifier obtained by a previous call to the DdeInitialize function.

hszService

Type: HSZ

A handle to the string that specifies the service name of the server application with which a conversation is to be established. If this parameter is 0L, the system attempts to establish conversations with all available servers that support the specified topic name.

hszTopic

Type: HSZ

A handle to 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 0L, the system will attempt to establish conversations on all topics supported by the selected server (or servers).

hConvList

Type: HCONVLIST

A handle to the conversation list to be enumerated. This parameter should be 0L if a new conversation list is to be established.

pCC

Type: PCONVCONTEXT

A pointer 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.

Return value

Type: HCONVLIST

If the function succeeds, the return value is the handle to a new conversation list.

If the function fails, the return value is 0L. The handle to the old conversation list is no longer valid.

The DdeGetLastError function can be used to get the error code, which can be one of the following values:

Remarks

An application must free the conversation list handle returned by the DdeConnectList function, regardless of whether any conversation handles within the list are active. To free the handle, an application can call DdeDisconnectList.

All members of the default CONVCONTEXT structure are set to zero except cb, specifying the size of the structure, and iCodePage, specifying CP_WINANSI (the default code page) or CP_WINUNICODE, depending on whether the ANSI or Unicode version of the DdeInitialize function was called by the client application.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ddeml.h (include Windows.h)
Library User32.lib
DLL User32.dll

See also

CONVCONTEXT

Conceptual

DdeConnect

DdeCreateStringHandle

DdeDisconnect

DdeDisconnectList

DdeInitialize

DdeQueryNextServer

Dynamic Data Exchange Management Library

Reference