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

📄 vcg21.htm

📁 Visual C++与数据库的连接经典实例
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<LI><I>Meeting message functions,</I> which let you manipulate request-for-meeting messages and responses to request messages

<BR>

<LI><I>Calendar functions,</I> which let you manipulate the dates, times, and durations of tasks and appointments

<BR>

</UL>

<P>In addition to declaring SAL function prototypes and global constants, you also need to declare several user-defined data types (structures).

<BR>

<BR>

<A NAME="E69E267"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>The SALAPP Sample Application</B></FONT></CENTER></H4>

<BR>

<P>The demonstration project, SALAPP.MAK, includes a program to create tasks and appointments, to specify user information, and to review replies to meeting request messages. The SALAPP form, which probably wouldn't win a prize in a Visual C++ application beauty contest, is shown in Figure 21.7.

<BR>

<P><B><A HREF="21vcg08.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/21vcg08.gif">Figure 21.7. The SALAPP form used to create a new appointment.</A></B>

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE><B>NOTE</B>

<BR>

<BR>Because SALAPP is a 16-bit application, it shouldn't be compiled with Visual C++ 4. Use Visual C++ 1.52, which is included with Visual C++ 4.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<P>SALAPP.MAK also includes the following modules:

<BR>

<UL>

<LI>DLGDALLS.C, which manages the dialog boxes in the sample application.

<BR>

<LI>SALCALLS.C, which receives the input and output from dialog boxes. Other utility functions can be found in this file as well.

<BR>

<LI>SALMAIN.C, which has the main functions for SAL.

<BR>

<LI>STRUCTS.C, which has support functions.

<BR>

</UL>

<P>Although SALAPP.MAK doesn't perform any functions that you can't handle better with the Schedule+ application itself, the declarations and functions contained in the .C modules can save you a substantial amount of time when it comes to writing your own Visual C++ application that uses SAL.

<BR>

<BR>

<A NAME="E69E268"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Visual C++ Database Applications and Schedule+</B></FONT></CENTER></H4>

<BR>

<P>There are only a few Visual C++ database applications in which you might want to incorporate SAL functions compared to mail-aware and telephony-aware or telephony-enabled applications, the subject of the next section. One application provides a connection between the built-in database of Microsoft Project 4.0 and Schedule+ to create tasks, assign completion dates, and block task times in the schedule of each member of the project team. An automated task assignment system can save a substantial amount of time and prevent errors associated with each member having to manually enter the data.

<BR>

<P>To create a task database, you can export Microsoft Project's task list to an ASCII file or an Excel worksheet and then use Access to import the ASCII file or worksheet into an Access database table. With Project 4.0, which supports OLE Automation and includes VBA, you could bypass the Access importation step and create a table with Visual C++. Alternatively, you can write VBA code to read the task data into an array and then process tasks for each member of the team without the intervening database.

<BR>

<BR>

<A NAME="E68E110"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>The Windows Telephony API (TAPI) and Visual C++</B></FONT></CENTER></H3>

<BR>

<P>Microsoft's new <I>Telephony API (TAPI)</I> is the latest addition to the Windows Open Services Architecture. TAPI was developed jointly by Microsoft and Intel Corp. and is a member of Microsoft's &quot;AtWork&quot; series of APIs and applications that are designed to use network connections to interrogate and control devices other than computers. When Microsoft adds the final touches to the other AtWork products, you'll be able to attach and control stand-alone fax machines, copiers, and perhaps even document-filing and transport systems over your network. One of the reasons for including this section in the same chapter as MAPI is that TAPI and MAPI (together with TSPI and MSPI, the service-provider interfaces) share a common model and perform similar functions.

<BR>

<P>The version of TAPI that was available at the time this book was written (and as supported by Visual C++ 4) is in the process of being finalized. Once TAPI is finalized, the necessary hardware is produced, and the software is written to provide access to telephony devices, you can expect PC vendors to supply computers with built-in telephone handsets or headsets. A phone built into a PC is a natural extension of the audio capabilities now being added to motherboards of PCs, eliminating the need to install an audio adapter card. Plus, a PC with a phone frees the desktop real estate you'll need in order to stack the documentation for these new APIs. The following sections provide a brief introduction to TAPI and show how TAPI fits into the Visual C++ database application picture.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE><B>NOTE</B>

<BR>

<BR>There is no MFC wrapper for the TAPI functionality with MFC 4.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE><B>NOTE</B>

<BR>

<BR>Microsoft has indicated that, unlike Windows for Workgroups 3.1x, Windows 95 won't have built-in support for ISDN. Microsoft expects others to provide this support. There have been indications that Microsoft will be working on improving Windows 95's ISDN support, probably as part of a Service Pack.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE><B>NOTE</B>

<BR>

<BR>Much of the information that follows is based on &quot;The Windows Telephony Approach,&quot; a Microsoft white paper that provides a general description of TAPI, and the Microsoft Telephony API and Telephony SPI Specifications that were published in MSDN CD4. The 16-bit version of the TAPI SDK was available on the January 1996 MSDN Level II CDs. For Win32, TAPI support is built in and doesn't use a separate SDK. You can download the preliminary TAPI specification as AP0503.EXE (a self-extracting .ZIP file) from Library 1 of the WINEXT forum or as TAPI.EXE from Library 7 of the Windows User's Group forum (WUGNET) on CompuServe.

<BR>

<BR>You also can search for information about TAPI on Microsoft's Internet site. The Microsoft World Wide Web page (<U>www.microsoft.com</U>) provides linkages to help you find this information. The TAPI SDK is available at <U><A HREF="tppmsgs/msgs2.htm#246" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/f%20tppabs="http://www.mcp.com/815616000/0-672/0-672-30913-0/f"tp://ftp.microsoft.com./Softlib/MSLFILES/TAPISDK.EX</U><U>E">ftp://ftp.microsoft.com./Softlib/MSLFILES/TAPISDK.EX</U><U>E</A></U>.

<BR>

<BR>Additional information may be found in the WIN32SDK directory of the Windows SDK.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE><B>NOTE</B>

<BR>

<BR>To get a list of all the files available from Microsoft on their FTP site, fetch and unzip the file ls-lr.zip. This file is updated daily with the complete listing of the FTP server. Be careful: The resulting text file is more than 160,000 lines long and more than 7M in size[md]a big chunk for most text editors!</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BR>

<A NAME="E69E269"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>TAPI Devices</B></FONT></CENTER></H4>

<BR>

<P>TAPI is designed to provide a computer-based connection between line devices and phone devices. TAPI defines these two device classes as follows:

<BR>

<UL>

<LI>A member of the line-device class is the abstract equivalent of one or more telephone lines. A line device can be one of the following:

<BR>

</UL>

<UL>

A single, conventional telephone company (telco) trunk line

<BR>

A line that provides both voice and signaling capability (used to connect extensions to a telephone control cabinet). Devices such as the popular digital key systems fit into this category.

<BR>

Multiple lines, such as those provided by Centrex service

<BR>

Voice store and forward services (voice mail) provided by a voice server

<BR>

A .WAV digital sound file on your computer

<BR>

Each line represents a channel of the line-device class. All channels in a line-device class must be identical.

<BR>

</UL>

<UL>

<LI>A member of the phone-device class emulates a telephone handset. Phone devices can be conventional handsets, multiline telephone (key) sets, or an audio adapter card that has a microphone and drives headphones or small speakers. PicturePhones and other teleconferencing devices also are included in the phone device class. Video services are provided by Windows 3.1's media control interface (MCI), part of the multimedia extensions to Windows, and multimedia video device drivers.

<BR>

</UL>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE><B>NOTE</B>

<BR>

<BR>Microsoft recently released Microsoft Voice. This product, available to OEMs of voice-compatible modems, adds a complete voice mail and audio messaging system to a PC. Two modem vendors who are planning or producing products incorporating Microsoft Voice are Diamond MultiMedia (TeleCommander 2500 and TeleCommander 3500 voice modem/sound cards) and Creative (the Phone Blaster voice modem/sound card). Other voice-compatible modem producers will certainly offer either Microsoft Voice or a similar product. Microsoft Voice is fully integrated with both TAPI and MAPI.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<P>The purpose of TAPI is to provide connection methodology between devices of the line and phone classes that is transparent to the physical implementation of the devices. Figure 21.8 represents a configuration in which a telephone connected to an adapter card in a workstation serves as a phone device. A voice server that is connected to a public telephone switch through conventional telco line pairs and to the workstation by an Ethernet LAN serves as the line device. Both the workstation and the server require adapter cards or built-in hardware interfaces to the devices, plus a TSPI-compliant driver for the hardware interface. TSPI is discussed in the following section.

<BR>

<P><B><A HREF="21vcg09.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/21vcg09.gif">Figure 21.8. Devices connected to a TAPI-compliant workstation and voice server.</A></B>

<BR>

<BR>

<A NAME="E69E270"></A>

<H4 ALIGN=CENTER>

⌨️ 快捷键说明

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