Platform SDK: Interprocess Communications |
The 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.
HCONVLIST DdeConnectList( DWORD idInst, // instance identifier HSZ hszService, // handle to service name string HSZ hszTopic, // handle to topic name string HCONVLIST hConvList, // handle to conversation list PCONVCONTEXT pCC // context data );
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:
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 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.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Ddeml.h; include Windows.h.
Library: Use User32.lib.
Dynamic Data Exchange Management Library Overview, Dynamic Data Exchange Management Functions, CONVCONTEXT, DdeConnect, DdeCreateStringHandle, DdeDisconnect, DdeDisconnectList, DdeInitialize, DdeQueryNextServer