⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch27.htm

📁 MAPI__SAPI__TAPI
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<html>

<head>
<title>Chapter 27 -- TAPI Behind the Scenes--The TELEPHON.INI File</title>
<meta NAME="GENERATOR" CONTENT="Microsoft FrontPage 3.0">
</head>

<body TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#CE2910">
<!-- Spidersoft WebZIP Ad Banner Insert -->
<!-- End of Spidersoft WebZIP Ad Banner Insert-->

<h1><font COLOR="#FF0000">Chapter 27</font></h1>

<h1><b><font SIZE="5" COLOR="#FF0000"><font SIZE="6" COLOR="#FF0000">TAPI Behind the 
Scenes--The </font><tt><font SIZE="6" COLOR="#FF0000" FACE="Courier">TELEPHON.INI</font></tt><font
SIZE="6" COLOR="#FF0000"> File</font></font></b> </h1>

<hr WIDTH="100%">

<h3 ALIGN="CENTER"><font SIZE="+2" COLOR="#000000">CONTENTS<a NAME="CONTENTS"></a> </font></h3>

<ul>
  <li><a HREF="#BuildingtheTAPIDialogUtilityProgram">Building the TAPI Dialog Utility Program</a> 
    <ul>
      <li><a HREF="#LayingOuttheTAPIDialogUtilityForm">Laying Out the TAPI Dialog Utility Form</a> 
      </li>
      <li><a HREF="#CodingtheTAPIDialogUtilityProject">Coding the TAPI Dialog Utility Project</a> </li>
    </ul>
  </li>
  <li><a HREF="#TheTELEPHONINIFile">The TELEPHON.INI File</a> </li>
  <li><a HREF="#TAPIServiceProviderInformation">TAPI Service Provider Information</a> <ul>
      <li><a HREF="#TheProvidersSection">The Providers Section</a> </li>
      <li><a HREF="#TheProviderSpecificSection">The Provider-Specific Section</a> </li>
    </ul>
  </li>
  <li><a HREF="#HandoffPrioritiesInformation">Handoff Priorities Information</a> </li>
  <li><a HREF="#DialingLocationInformation">Dialing Location Information</a> <ul>
      <li><a HREF="#ModifyingtheLocationValueswiththel">Modifying the Location Values with the 
        lineTranslateDialog Method</a> </li>
    </ul>
  </li>
  <li><a HREF="#CreditCardDialingInstructions">Credit Card Dialing Instructions</a> <ul>
      <li><a HREF="#UnderstandingtheTAPIDialingRules">Understanding the TAPI Dialing Rules</a> </li>
      <li><a HREF="#TestingtheCallingCardSettingsofTAP">Testing the Calling Card Settings of 
        TAPIDLG.EXE</a> </li>
    </ul>
  </li>
  <li><a HREF="#Summary">Summary</a> </li>
</ul>

<hr>

<p><font COLOR="#000000">In this chapter you'll learn how the TAPI system uses entries in 
the </font><tt><font FACE="Courier">TELEPHON.INI</font></tt> file to determine what TAPI 
service providers are installed, how to handle outbound dialing rules, the current dialing 
location, and which providers are to be used for TAPI service requests. </p>

<p>Almost all of this information is updated from the various configuration dialog boxes 
available through calls to TAPI functions. As part of this chapter, you'll build a short 
program that calls the TAPI Line dialog boxes and allows you to inspect the resulting 
changes to the <tt><font FACE="Courier">TELEPHON.INI</font></tt> file. </p>

<h2><a NAME="BuildingtheTAPIDialogUtilityProgram"><font SIZE="5" COLOR="#FF0000">Building 
the TAPI Dialog Utility Program</font></a></h2>

<p>Before getting into the details of how the <tt><font FACE="Courier">TELEPHON.INI</font></tt> 
file is used for TAPI services, let's build a short Visual Basic program that gives you 
easy access to the TAPI dialog boxes that affect the file, and a quick <tt><font
FACE="Courier">TELEPHON.INI</font></tt> viewer. </p>
<div align="center"><center>

<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
  <tr>
    <td><b>Note</b></td>
  </tr>
  <tr>
    <td><blockquote>
      <p>If you do not have Visual Basic on your machine or you want to skip over this section, 
      you can find the completed program (<tt><font FACE="Courier">TAPIDLG.EXE</font></tt>) on 
      the CD-ROM that comes with this book. You can use this compiled version of the program to 
      follow along with the rest of the chapter. </p>
    </blockquote>
    </td>
  </tr>
</table>
</center></div>

<p>Creating the TAPI Dialog Utility project takes only a few controls and a small amount 
of code. The following two sections of the chapter will walk you through the details of 
building this handy utility. </p>

<h3><a NAME="LayingOuttheTAPIDialogUtilityForm">Laying Out the TAPI Dialog Utility Form</a></h3>

<p>Start by loading Visual Basic 4.0 and creating a new project. Next, you need to lay out 
the form. Refer to Table 27.1 and Figure 27.1 as guides. Be sure to load the <tt><font
FACE="Courier">TAPILINE.OCX</font></tt> into your toolbox before you start coding. Also, 
make sure you add the frame control <i>before </i>you add the option buttons, and paint 
the option buttons within the frame control. That way they will be registered as child 
controls of the frame. </p>

<p><a HREF="f27-1.gif"><b>Figure 27 1 : </b><i>Laying out the TAPI Dialog Utility project </i></a></p>
<div align="center"><center>

<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
  <tr>
    <td><b>Tip</b></td>
  </tr>
  <tr>
    <td><blockquote>
      <p>If you plan to do a lot of coding with the <tt><font FACE="Courier">TAPILINE</font></tt> 
      control, add it to your startup project. Open <tt><font FACE="Courier">AUTO32LD.VBP</font></tt> 
      (or <tt><font FACE="Courier">AUTO16LD.VBP</font></tt>) and add the <tt><font
      FACE="Courier">TAPILINE</font></tt> control. Then save the project. Now every new project 
      you create will have the <tt><font FACE="Courier">TAPILINE</font></tt> control in the 
      toolbox. </p>
    </blockquote>
    </td>
  </tr>
</table>
</center></div>

<p align="center"><b>Table 27.1. Controls for the TAPI Dialog Utility project.</b> </p>
<div align="center"><center>

<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
  <tr>
    <td><i>Control</i></td>
    <td WIDTH="129"><i>Property</i> </td>
    <td WIDTH="174"><i>Setting</i></td>
  </tr>
  <tr>
    <td WIDTH="215"><tt><font FACE="Courier">VB.Form</font></tt> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Name</font></tt></td>
    <td WIDTH="174">Form1</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Caption</font></tt> </td>
    <td WIDTH="174">&quot;Form1&quot;</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Height</font></tt> </td>
    <td WIDTH="174">2670</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Left</font></tt> </td>
    <td WIDTH="174">1530</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Top</font></tt> </td>
    <td WIDTH="174">1770</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Width</font></tt> </td>
    <td WIDTH="174">5685</td>
  </tr>
  <tr>
    <td WIDTH="215"><tt><font FACE="Courier">VB.CommandButton</font></tt> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Name</font></tt></td>
    <td WIDTH="174">cmdButton</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Caption</font></tt> </td>
    <td WIDTH="174">&quot;&amp;Telepho.ini&quot;</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Height</font></tt> </td>
    <td WIDTH="174">495</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Index</font></tt> </td>
    <td WIDTH="174">2</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Left</font></tt> </td>
    <td WIDTH="174">60</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">TabIndex</font></tt> </td>
    <td WIDTH="174">8</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Top</font></tt> </td>
    <td WIDTH="174">1620</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Width</font></tt> </td>
    <td WIDTH="174">1215</td>
  </tr>
  <tr>
    <td WIDTH="215"><tt><font FACE="Courier">VB.ListBox</font></tt> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Name</font></tt></td>
    <td WIDTH="174">List1</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Height</font></tt> </td>
    <td WIDTH="174">1035</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Left</font></tt> </td>
    <td WIDTH="174">60</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">TabIndex</font></tt> </td>
    <td WIDTH="174">6</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Top</font></tt> </td>
    <td WIDTH="174">420</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Width</font></tt> </td>
    <td WIDTH="174">2595</td>
  </tr>
  <tr>
    <td WIDTH="215"><tt><font FACE="Courier">VB.CommandButton</font></tt> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Name</font></tt></td>
    <td WIDTH="174">cmdButton</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Caption</font></tt> </td>
    <td WIDTH="174">&quot;&amp;Apply&quot;</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Height</font></tt> </td>
    <td WIDTH="174">495</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Index</font></tt> </td>
    <td WIDTH="174">1</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Left</font></tt> </td>
    <td WIDTH="174">4200</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">TabIndex</font></tt> </td>
    <td WIDTH="174">5</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Top</font></tt> </td>
    <td WIDTH="174">1680</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Width</font></tt> </td>
    <td WIDTH="174">1215</td>
  </tr>
  <tr>
    <td WIDTH="215"><tt><font FACE="Courier">VB.CommandButton</font></tt> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Name</font></tt></td>
    <td WIDTH="174">cmdButton</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Caption</font></tt> </td>
    <td WIDTH="174">&quot;E&amp;xit&quot;</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Height</font></tt> </td>
    <td WIDTH="174">495</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Index</font></tt> </td>
    <td WIDTH="174">0</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Left</font></tt> </td>
    <td WIDTH="174">2820</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">TabIndex</font></tt> </td>
    <td WIDTH="174">4</td>
  </tr>
  <tr>
    <td WIDTH="215"> </td>
    <td WIDTH="129"><tt><font FACE="Courier">Top</font></tt> </td>
    <td WIDTH="174">1680</td>
  </tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -