| Platform SDK: TAPI |
The following code fragment illustrates establishing a connection to a known ILS server.
// Create the Rendezvous component.
ITRendezvous *pRend;
CoCreateInstance(
CLSID_Rendezvous,
NULL,
CLSCTX_INPROC_SERVER,
IID_ITRendezvous,
(void **)&pRend
);
// Set the ILS server name.
BSTR bName = SysAllocString( wstrServerName );
// Create the directory component.
ITDirectory *pDirectory;
hr = pRend->CreateDirectory(
DT_ILS,
bName,
&pDirectory
);
// Connect to the server.
hr = pDirectory->Connect(FALSE);