Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

When the application initializes TAPI, it must establish a way to communicate with TAPI. By calling the lineInitializefunction, the application submits the address of a callback function to TAPI. By using the lineInitializeExfunction, the application can choose either callback notifications or a Microsoft Win32® event-based notification. By use of the event-based notification mechanism, the application can retrieve TAPI messages as they become available by calling the lineGetMessagefunction. lineGetMessagecan be used to wait a specified amount of time for the next message. The application also can wait on the event itself. The event handle is returned in the LINEINITIALIZEEXPARAMS.Handles.hEventmember.

The following code example shows how to initialize TAPI.

Copy Code
DWORD InitializeTAPI()
{
	LPLINETRANSLATECAPS lpXlatCaps;
	LONG  rc;

	LINEINITIALIZEEXPARAMS	LineInitializeExParams = {
		sizeof(LINEINITIALIZEEXPARAMS), //dwTotalSize
		0, 							 //dwNeededSize
		0, 							 //dwUsedSize
		LINEINITIALIZEEXOPTION_USEEVENT,   //dwOptions
		0, 							 //Handles
		0								//dwCompletionKey
};

	dwAPIVersion = TAPI_CURRENT_VERSION;
	dwExtVersion = 0;

	rc = lineInitializeEx(
			&hLineApp,
			hInstance,
			NULL,
			szAppName,
			&dwNumLines,
			&dwAPIVersion,
			&LineInitializeExParams
			);
 
	if (rc) {
		NKDbgPrintfW(TEXT("%s: lineInitializeEx failed %x\n"),
szAppName, rc);
}
	return rc;
}

See Also