?? func2_1tbs.htm
字號:
<DD>A pointer to a <B>DWORD</B>. The application must initialize this <B>DWORD</B>, before calling this function, to the highest API version it is designed to support (for example, the same value it would pass into <I>dwAPIHighVersion</I> parameter of <A HREF="func2_98ry.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_98ry.htm"><B>phoneNegotiateAPIVersion</B></A>). Artificially high values must not be used; the value must be accurately set. TAPI translates any newer messages or structures into values or formats supported by the application's version. Upon successful completion of this request, this location is filled with the highest API version supported by TAPI, thereby allowing the application to detect and adapt to having been installed on a system with an older version of TAPI. </DD>
<DT><I>lpPhoneInitializeExParams</I> </DT>
<DD>A pointer to a structure of type <A HREF="struc2_6ohe.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_6ohe.htm"><B>PHONEINITIALIZEEXPARAMS</B></A> containing additional parameters used to establish the association between the application and TAPI (specifically, the application's selected event notification mechanism and associated parameters).
</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>PHONEERR_INVALAPPNAME, PHONEERR_OPERATIONFAILED, PHONEERR_INIFILECORRUPT, PHONEERR_INVALPOINTER, PHONEERR_REINIT, PHONEERR_NOMEM, PHONEERR_INVALPARAM.</P>
<H4>Remarks</H4>
<P>Applications must select one of three mechanisms by which TAPI notifies the application of telephony events: Hidden Window, Event Handle, or Completion Port.
<UL>
<LI>The <B>Hidden Window</B> mechanism is selected by specifying PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW in the <B>dwOptions</B> member in the <A HREF="struc2_6ohe.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_6ohe.htm"><B>PHONEINITIALIZEEXPARAMS</B></A> structure. In this mechanism (which is the only mechanism available to TAPI version 1.<I>x</I> applications), TAPI creates a window in the context of the application during the <B>phoneInitializeEx</B> function, and subclasses the window so that all messages posted to it are handled by a WNDPROC in TAPI itself. When TAPI has a message to deliver to the application, TAPI posts a message to the hidden window. When the message is received (which can happen only when the application calls the Windows <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winui/messques_10kl.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winui/messques_10kl.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winui/messques_10kl.htm"><B>GetMessage</B></A> function), Windows switches the process context to that of the application and invokes the WNDPROC in TAPI. TAPI then delivers the message to the application by calling the <A HREF="func2_26sj.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_26sj.htm"><B>phoneCallbackFunc</B></A>, a pointer to which the application provided as a parameter in its call to <B>phoneInitializeEx</B> (or <A HREF="func2_36g5.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_36g5.htm"><B>phoneInitialize</B></A>, for TAPI version 1.3 and 1.4 applications). This mechanism requires the application to have a message queue (which is not desirable for service processes) and to service that queue regularly to avoid delaying processing of telephony events. The hidden window is destroyed by TAPI during the <A HREF="func2_7b8u.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_7b8u.htm"><B>phoneShutdown</B></A> function. </LI>
<LI>The <B>Event Handle</B> mechanism is selected by specifying PHONEINITIALIZEEXOPTION_USEEVENT in the <B>dwOptions</B> member in the <A HREF="struc2_6ohe.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_6ohe.htm"><B>PHONEINITIALIZEEXPARAMS</B></A> structure. In this mechanism, TAPI creates an event object on behalf of the application, and returns a handle to the object in the <B>hEvent</B> member in <B>PHONEINITIALIZEEXPARAMS</B>. The application must not manipulate this event in any manner (for example, must not call <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winbase/synchro_8ut0.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winbase/synchro_8ut0.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winbase/synchro_8ut0.htm"><B>SetEvent</B></A>, <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winbase/synchro_4f78.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winbase/synchro_4f78.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winbase/synchro_4f78.htm"><B>ResetEvent</B></A>, <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winbase/handobj_289x.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winbase/handobj_289x.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winbase/handobj_289x.htm"><B>CloseHandle</B></A>, and so on) or undefined behavior results; the application can only wait on this event using functions such as <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winbase/synchro_4ldg.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winbase/synchro_4ldg.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winbase/synchro_4ldg.htm"><B>WaitForSingleObject</B></A> or <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winbase/synchro_2esz.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winbase/synchro_2esz.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winbase/synchro_2esz.htm"><B>MsgWaitForMultipleObjects</B></A>. TAPI signals this event whenever a telephony event notification is pending for the application; the application must call <A HREF="func2_6ld1.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_6ld1.htm"><B>phoneGetMessage</B></A> to fetch the contents of the message. The event is reset by TAPI when no events are pending. The event handle is closed and the event object destroyed by TAPI during the <A HREF="func2_7b8u.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_7b8u.htm"><B>phoneShutdown</B></A> function. The application is not required to wait on the event handle that is created; the application could choose instead to call <B>phoneGetMessage</B> and have it block waiting for a message to be queued. </LI>
<LI>The <B>Completion Port</B> mechanism is selected by specifying PHONEINITIALIZEEXOPTION_USECOMPLETION PORT in the <B>dwOptions</B> member in the <A HREF="struc2_6ohe.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_6ohe.htm"><B>PHONEINITIALIZEEXPARAMS</B></A> structure. In this mechanism, whenever a telephony event needs to be sent to the application, TAPI sends it to the application using <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winbase/filesio_33g3.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winbase/filesio_33g3.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winbase/filesio_33g3.htm"><B>PostQueuedCompletionStatus</B></A> to the completion port that the application specified in the <B>hCompletionPort</B> member in <B>PHONEINITIALIZEEXPARAMS</B>, tagged with the completion key that the application specified in the <B>dwCompletionKey</B> member in <B>PHONEINITIALIZEEXPARAMS</B>. The application must have previously created the completion port using <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winbase/filesio_4k1g.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winbase/filesio_4k1g.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winbase/filesio_4k1g.htm"><B>CreateIoCompletionPort</B></A>. The applications retrieves events using <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winbase/filesio_071v.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winbase/filesio_071v.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winbase/filesio_071v.htm"><B>GetQueuedCompletionStatus</B></A>. Upon return from <B>GetQueuedCompletionStatus</B>, the application has the specified <B>dwCompletionKey</B> written to the <B>DWORD</B> pointed to by the <I>lpCompletionKey</I> parameter, and a pointer to a <A HREF="struc2_9ofm.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_9ofm.htm"><B>PHONEMESSAGE</B></A> structure returned to the location pointed to by <I>lpOverlapped</I>. After the application has processed the event, the application must call <A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/winbase/memman_2339.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/library/psdk/winbase/memman_2339.htm'" tppabs="http://msdn.microsoft.com/library/psdk/winbase/memman_2339.htm"><B>LocalFree</B></A> to release the memory used to contain the <B>PHONEMESSAGE</B> structure. Because the application created the completion port (thereby allowing it to be shared for other purposes), the application must close it; the application must not close the completion port until after calling <A HREF="func2_7b8u.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_7b8u.htm"><B>phoneShutdown</B></A>. </LI>
</UL>
<P>When a multithreaded application is using the Event Handle mechanism and more than one thread is waiting on the handle, or the Completion Port notification mechanism and more than one thread is waiting on the port, it is possible for telephony events to be processed out of sequence. This is not due to the sequence of delivery of events from TAPI, but would be caused by the time slicing of threads or the execution of threads on separate processors. </P>
<P>If PHONEERR_REINIT is returned and TAPI reinitialization has been requested (for example, as a result of adding or removing a telephony service provider), then <B>phoneInitializeEx</B> requests are rejected with this error until the last application shuts down its usage of the API (using <A HREF="func2_7b8u.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_7b8u.htm"><B>phoneShutdown</B></A>). At that time, the new configuration becomes effective and applications are once again permitted to call <B>phoneInitializeEx</B>. </P>
<P>If the PHONEERR_INVALPARAM error value is returned, the specified <I>hInstance</I> parameter is invalid. </P>
<P>The application can refer to individual phone devices by using phone device identifiers that range from zero to <I>dwNumDevs</I> minus one. An application should not assume that these phone devices are capable of any particular TAPI function without first querying their device capabilities by <A HREF="func2_3l6b.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_3l6b.htm"><B>phoneGetDevCaps</B></A>. </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>Requires Windows NT 4.0 SP3 or later.<BR>
<B> Windows 95/98: </B>Requires Windows 95 or later.<BR>
<B> Version: </B>Requires TAPI 2.0 or later.<BR>
<B> Header: </B>Declared in Tapi.h.<BR>
<B> Library: </B>Use Tapi32.lib.<BR>
<B> Unicode: </B>Implemented as Unicode and ANSI versions on all platforms.</P>
<H4>See Also</H4>
<P><A HREF="quickref_1okl.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/quickref_1okl.htm">TAPI 2.2 Reference Overview</A>, <A HREF="quickref_4rub.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/quickref_4rub.htm">Supplementary Phone Service Functions</A>, <A HREF="func2_26sj.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_26sj.htm"><B>phoneCallbackFunc</B></A>, <A HREF="func2_3l6b.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_3l6b.htm"><B>phoneGetDevCaps</B></A>, <A HREF="func2_6ld1.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_6ld1.htm"><B>phoneGetMessage</B></A>, <A HREF="struc2_6ohe.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_6ohe.htm"><B>PHONEINITIALIZEEXPARAMS</B></A>, <A HREF="struc2_9ofm.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_9ofm.htm"><B>PHONEMESSAGE</B></A>, <A HREF="func2_98ry.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_98ry.htm"><B>phoneNegotiateAPIVersion</B></A>, <A HREF="func2_7b8u.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_7b8u.htm"><B>phoneShutdown</B></A>, <A HREF="struc2_3do2.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_3do2.htm"><B>PHONESTATUS</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 + -