The lineInitialize function is obsolete. It continues to be exported by tapi.dll and tapi32.dll for backward compatibility with applications using API versions 1.3 and 1.4.
Applications using API version 2.0 or later must use lineInitializeEx instead.
The lineInitialize function initializes the application's use of Tapi.dll for subsequent use of the line abstraction. The function registers the application's specified notification mechanism and returns the number of line devices available to the application. A line device is any device that provides an implementation for the line-prefixed functions in TAPI.
LONG lineInitialize(
LPHLINEAPP lphLineApp,
HINSTANCE hInstance,
LINECALLBACK lpfnCallback,
LPCSTR lpszAppName,
LPDWORD lpdwNumDevs
);
Returns zero if the request succeeds or a negative error number if an error occurs. Possible return values are:
LINEERR_INVALAPPNAME, LINEERR_OPERATIONFAILED, LINEERR_INIFILECORRUPT, LINEERR_RESOURCEUNAVAIL, LINEERR_INVALPOINTER, LINEERR_REINIT, LINEERR_NODRIVER, LINEERR_NODEVICE, LINEERR_NOMEM, LINEERR_NOMULTIPLEINSTANCE.
If LINEERR_REINIT is returned and TAPI reinitialization has been requested (for example as a result of adding or removing a telephony service provider), then lineInitialize requests are rejected with this error until the last application shuts down its usage of the API (using lineShutdown). At that time, the new configuration becomes effective and applications are once again permitted to call lineInitialize. If the LINEERR_INVALPARAM error value is returned, the specified hInstance parameter is invalid.
The application can refer to individual line devices by using line device identifiers that range from zero to dwNumDevs minus one. An application should not assume that these line devices are capable of anything beyond what is specified by the Basic Telephony subset without first querying their device capabilities using lineGetDevCaps and lineGetAddressCaps.
Applications should not invoke lineInitialize without subsequently opening a line (at least for monitoring). If the application is not monitoring and not using any devices, it should call lineShutdown so that memory resources allocated by tapi.dll can be released if unneeded, and tapi.dll itself can be unloaded from memory while not needed.
Another reason for performing a lineShutdown is that if a user changes the device configuration (adds or removes a line or phone), there is no way for TAPI to notify an application that has a line or phone handle open at the time. After a reconfiguration has taken place, causing a LINEDEVSTATE_REINIT message to be sent, no applications can open a device until all applications have performed a lineShutdown. If any service provider fails to initialize properly, this function fails and returns the error indicated by the service provider.
On all TAPI platforms, lineInitialize is equivalent to lineInitializeEx() using the LINEINITIALIZEEXOPTION_USEHIDDENWINDOW option.
Version: Use TAPI version 1.4. Not available in TAPI 2.0 or later.
Header: Declared in tapi.h.
Import Library: Link with tapi32.lib.
lineCallbackFunc, LINECALLINFO, lineGetAddressCaps, lineGetDevCaps, lineInitializeEx, lineShutdown