📄 func1_26lh.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML DIR="LTR"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso8859-1">
</HEAD>
<TITLE>lineInitialize</TITLE>
<SCRIPT SRC="/library/psdk/linkcss.js"></SCRIPT>
<META NAME="MS-HKWD" CONTENT="lineInitialize">
<META NAME="MS-HAID" CONTENT="_tapi2_lineinitialize">
</HEAD>
<BODY TOPMARGIN="0">
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<!--SYNC_START-->
<script language="JavaScript" src='/library/synch.js'></script>
<!--SYNC_END-->
<H1><A NAME="_tapi2_lineinitialize"></A>lineInitialize</H1>
<P>The <B>lineInitialize</B> 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. </P>
<P>Applications using API version 2.0 or later must use <A HREF="func1_2o54.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_2o54.htm"><B>lineInitializeEx</B></A> instead. </P>
<H2>For TAPI Versions 1.4 and Earlier</H2>
<P>The<B> lineInitialize</B> 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.</P>
<PRE class=syntax><B>LONG WINAPI lineInitialize(
LPHLINEAPP</B><I> lphLineApp</I><B>, </B>
<B> HINSTANCE</B><I> hInstance</I><B>, </B>
<B> LINECALLBACK</B><I> lpfnCallback</I><B>, </B>
<B> LPCSTR</B><I> lpszAppName</I><B>, </B>
<B> LPDWORD</B><I> lpdwNumDevs </I>
<B>);</B></PRE>
<H4>Parameters</H4>
<DL>
<DT><I>lphLineApp</I></DT>
<DD>A pointer to a location that is filled with the application's usage handle for TAPI.</DD>
<DT><I>hInstance</I></DT>
<DD>The instance handle of the client application or DLL.</DD>
<DT><I>lpfnCallback</I></DT>
<DD>The address of a callback function that is invoked to determine status and events on the line device, addresses, or calls. For more information, see <A HREF="func1_31lv.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_31lv.htm"><B>lineCallbackFunc</B></A>.</DD>
<DT><I>lpszAppName</I></DT>
<DD>A pointer to a null-terminated text string that contains only displayable characters. If this parameter is not NULL, it contains an application-supplied name for the application. This name is provided in the <A HREF="struc1_4oky.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc1_4oky.htm"><B>LINECALLINFO</B></A> structure to indicate, in a user-friendly way, which application originated, or originally accepted or answered the call. This information can be useful for call logging purposes. If <I>lpszAppName</I> is NULL, the application's file name is used instead.</DD>
<DT><I>lpdwNumDevs</I></DT>
<DD>A pointer to a <B>DWORD</B>-sized location. Upon successful completion of this request, this location is filled with the number of line devices available to the application.
</DD>
</DL>
<H4>Return Values</H4>
<P>Returns zero if the request succeeds or a negative error number if an error occurs. Possible return values are:</P>
<P>LINEERR_INVALAPPNAME, LINEERR_OPERATIONFAILED, LINEERR_INIFILECORRUPT, LINEERR_RESOURCEUNAVAIL, LINEERR_INVALPOINTER, LINEERR_REINIT, LINEERR_NODRIVER, LINEERR_NODEVICE, LINEERR_NOMEM, LINEERR_NOMULTIPLEINSTANCE.</P>
<H4>Remarks</H4>
<P>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 <B>lineInitialize</B> requests are rejected with this error until the last application shuts down its usage of the API (using <A HREF="func2_7sq6.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_7sq6.htm"><B>lineShutdown</B></A>). At that time, the new configuration becomes effective and applications are once again permitted to call <B>lineInitialize</B>. If the LINEERR_INVALPARAM error value is returned, the specified <I>hInstance</I> parameter is invalid.</P>
<P>The application can refer to individual line devices by using line device identifiers that range from zero to <I>dwNumDevs</I> 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 <A HREF="func1_2lbn.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_2lbn.htm"><B>lineGetDevCaps</B></A> and <A HREF="func1_533n.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_533n.htm"><B>lineGetAddressCaps</B></A>.</P>
<P>Applications should not invoke <B>lineInitialize</B> without subsequently opening a line (at least for monitoring). If the application is not monitoring and not using any devices, it should call <A HREF="func2_7sq6.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_7sq6.htm"><B>lineShutdown</B></A> 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.</P>
<P>Another reason for performing a <B>lineShutdown</B> 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 <B>lineShutdown</B>. If any service provider fails to initialize properly, this function fails and returns the error indicated by the service provider.</P>
<P>On all TAPI platforms, <B>lineInitialize</B> is equivalent to <A HREF="func1_2o54.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_2o54.htm"><B>lineInitializeEx</B></A> using the LINEINITIALIZEEXOPTION_USEHIDDENWINDOW option.</P>
<H4><A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/sdkintro/guide_927n.htm \n\n这个文件不能通过 Teleport Pro 取回, 因为 地址在一个域或为它的开始地址设定的边界的外部路径上. \n\n你想从服务器打开它吗?'))window.location='http://msdn.microsoft.com/library/psdk/sdkintro/guide_927n.htm'" tppabs="http://msdn.microsoft.com/library/psdk/sdkintro/guide_927n.htm">Requirements</A> </H4>
<P><B> Windows NT/2000: </B>Unsupported.<BR>
<B> Windows 95/98: </B>Requires Windows 95 only.<BR>
<B> Version: </B>Requires TAPI 1.4 or earlier.<BR>
<B> Header: </B>Declared in Tapi.h.<BR>
<B> Library: </B>Use Tapi32.lib.</P>
<H4>See Also</H4>
<P><A HREF="func1_31lv.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_31lv.htm"><B>lineCallbackFunc</B></A>, <A HREF="struc1_4oky.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc1_4oky.htm"><B>LINECALLINFO</B></A>, <A HREF="func1_533n.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_533n.htm"><B>lineGetAddressCaps</B></A>, <A HREF="func1_2lbn.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_2lbn.htm"><B>lineGetDevCaps</B></A>, <A HREF="func1_2o54.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_2o54.htm"><B>lineInitializeEx</B></A>, <A HREF="func2_7sq6.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_7sq6.htm"><B>lineShutdown</B></A> </P>
<DIV CLASS="footer">Built on Monday, August 14, 2000</DIV>
<!--FOOTER_START-->
<DIV CLASS="footer" STYLE="color:#000000;font-size:90%;">
<A HREF="mailto:sdkfdbk@microsoft.com">Send feedback</A> to the Platform SDK.</P>
<P><A HREF="javascript:if(confirm('http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm \n\n这个文件不能通过 Teleport Pro 取回, 因为 地址在一个域或为它的开始地址设定的边界的外部路径上. \n\n你想从服务器打开它吗?'))window.location='http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm'" tppabs="http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm" TARGET="_top">© 1999 Microsoft Corporation. All rights reserved. Terms of use.</A></P>
</DIV>
<!--FOOTER_END-->
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -