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

📄 214-216.html

📁 WindowsCE.[Essential Windows CE Application Programming].Jon Wiley & Son.zip
💻 HTML
📖 第 1 页 / 共 2 页
字号:
			<option value="/reference/dir.webservices.html">Web Services
			<option value="/reference/dir.webmasterskills1.html">Webmaster
			<option value="/reference/dir.y2k1.html">Y2K
			<option value="">-----------
			<option value="/reference/whatsnew.html">New Titles
			<option value="">-----------
			<option value="/reference/dir.archive1.html">Free Archive		
			</SELECT>
			</font></td>
	</tr>
	</table>
	</form>
<!-- LEFT NAV SEARCH END -->

		</td>
		
<!-- PUB PARTNERS END -->
<!-- END LEFT NAV -->

<td rowspan="8" align="right" valign="top"><img src="/images/iswbls.gif" width=1 height=400 alt="" border="0"></td>
<td><img src="/images/white.gif" width="5" height="1" alt="" border="0"></td>
<!-- end of ITK left NAV -->

<!-- begin main content -->
<td width="100%" valign="top" align="left">


<!-- END SUB HEADER -->

<!--Begin Content Column -->

<FONT FACE="Arial,Helvetica" SIZE="-1">
To access the contents, click the chapter and section titles.
</FONT>
<P>
<B>Essential Windows CE Application Programming</B>
<FONT SIZE="-1">
<BR>
<I>(Publisher: John Wiley & Sons, Inc.)</I>
<BR>
Author(s): Robert Burdick
<BR>
ISBN: 0471327476
<BR>
Publication Date: 03/01/99
</FONT>
<P>
<form name="Search" method="GET" action="http://search.earthweb.com/search97/search_redir.cgi">

<INPUT TYPE="hidden" NAME="Action" VALUE="Search">
<INPUT TYPE="hidden" NAME="SearchPage" VALUE="http://search.earthweb.com/search97/samples/forms/srchdemo.htm">
<INPUT TYPE="hidden" NAME="Collection" VALUE="ITK">
<INPUT TYPE="hidden" NAME="ResultTemplate" VALUE="itk-simple-intrabook.hts">
<INPUT TYPE="hidden" NAME="ViewTemplate" VALUE="view.hts">

<font face="arial, helvetica" size=2><b>Search this book:</b></font><br>
<INPUT NAME="queryText" size=50 VALUE="">&nbsp;<input type="submit" name="submitbutton" value="Go!">
<INPUT type=hidden NAME="section_on" VALUE="on">
<INPUT type=hidden NAME="section" VALUE="http://www.itknowledge.com/reference/standard/0471327476/">

</form>


<!-- Empty Reference Subhead -->

<!--ISBN=0471327476//-->
<!--TITLE=Essential Windows CE Application Programming//-->
<!--AUTHOR=Robert Burdick//-->
<!--PUBLISHER=John Wiley & Sons, Inc.//-->
<!--IMPRINT=Wiley Computer Publishing//-->
<!--CHAPTER=7//-->
<!--PAGES=214-216//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="211-214.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="216-221.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading12"></A><FONT COLOR="#000077">The Contacts Database</FONT></H3>
<P>Perhaps you will recognize this scenario from your college years. (It comes directly from mine.) It&#146;s the next to last week of one of your more grueling calculus courses. You&#146;ve spent the entire time learning how to manually integrate impossibly complex functions that you are convinced you will never encounter in the &#147;real world,&#148; using techniques such as the Laplace Transform and integration by parts. Then, almost as an afterthought, your calculus professor makes a brief foray into the subject of how to use an integral table. The chorus of grief is as varied as the students in the classroom, but can be paraphrased something like this: &#147;You mean to tell me we&#146;ve suffered through this integration business and could have used a cookbook all along?&#148; Prepare for a trip down memory lane. I am about to pull the same thing on you now.
</P>
<P>Windows CE provides a predefined database of its own for storing phone number and other personal and business contact information. A number of the applications that are traditionally supplied with Windows CE&#150;based devices use this database. It therefore lives in the Windows CE operating system for all application developers to use. The <I>contacts database</I> stores many more useful properties than our phone list database example above. And it provides a complete application programming interface for performing such operations as adding, removing, and modifying information in the database. Given that this rich functionality exists in the operating system for free, why did I just painstakingly guide you through all of the mechanics of programming generic Windows CE databases?</P>
<P>The contacts database is just one example of the type of database that a typical Windows CE application may need to use. Much as an integral table cannot contain all of the cases an engineer might encounter in practice, the built-in features of an operating system like Windows CE cannot anticipate every application that it will be asked to support. It is therefore crucial to have a well-established understanding of the fundamental capabilities of Windows CE in order to confidently approach any new programming challenge.</P>
<P>Applying the experience of our generic phone list application makes understanding the design and features of the contacts database a straightforward task. Since we have successfully explored the mechanics of generic Windows CE databases, the next sections will only briefly cover the highlights of the contacts database. To extend the classroom metaphor, the full details of using the contacts database are left to the student as an exercise!</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B><B>L<SMALL>INK WITH</SMALL> ADDRSTOR.LIB</B>
<P><B>To use the contacts database, your applications must link with ADDRSTOR.LIB and include the file ADDRSTOR.H.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<P><FONT SIZE="+1"><B>Address Cards</B></FONT></P>
<P>Windows CE models the concept of a contact as <I>address cards</I>. This name is supposedly meant to conjure up the image of cards in a Rolodex. The address card is implemented as a structure with the following definition:</P>
<!-- CODE //-->
<PRE>
   typedef struct _AddressCard
   &#123;
     SYSTEMTIME stBirthday;
     SYSTEMTIME stAnniversary;
     TCHAR *pszBusinessFax;
     TCHAR *pszCompany;
     TCHAR *pszDepartment;
     TCHAR *pszEmail;
     TCHAR *pszMobilePhone;
     TCHAR *pszOfficeLocation;
     TCHAR *pszPager;
     TCHAR *pszWorkPhone;
     TCHAR *pszTitle;
     / Other properties such as name, address, fax number, etc.
   &#125; AddressCard;
</PRE>
<!-- END CODE //-->
<P>This structure is the contacts database analog of the PHONERECORD structure in our phone list database example. Each member of the AddressCard structure represents one of the properties in a particular contacts database record.
</P>
<P>The properties of address card records are identified by <I>property tags</I>. The concept of property tags comes from the Microsoft Messaging Application Programming Interface (MAPI). In reality, though, a property tag is nothing more than a property identifier like PL_LASTNAME, PL_FIRSTNAME, PL_PHONENUMBER, and PL_DEPT in the phone list application. The property tags for the contacts database all have names of the form HHPR_*. For example, the birthday property has a property identifier HHPR_BIRTHDAY. These identifiers are used to specify the properties that are to be read from or written to records in the contacts database, as we will see a bit later.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="211-214.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="216-221.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>


<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->
<!-- reference_footer = subfoot -->

<!-- BEGIN SUB FOOTER -->
		<br><br>
		</TD>
    </TR>
	</TABLE>

		
	<table width="640" border=0 cellpadding=0 cellspacing=0>
		<tr>
		<td align="left" width=135><img src="/images/white.gif" width=100 height="1" alt="" border="0"></td>
		
		
<!-- END SUB FOOTER -->

<!-- all of the books have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->
<!-- reference_footer = subfoot -->

<!-- FOOTER -->
			
		<td width="515" align="left" bgcolor="#FFFFFF">
<font face="arial, helvetica" size="1"><b><a href="/products.html"><font color="#006666">Products</font></a>&nbsp;|&nbsp; <a href="/contactus.html"><font color="#006666">Contact Us</font></a>&nbsp;|&nbsp; <a href="/aboutus.html"><font color="#006666">About Us</font></a>&nbsp;|&nbsp; <a href="http://www.earthweb.com/corporate/privacy.html" target="_blank"><font color="#006666">Privacy</font></a> &nbsp;|&nbsp; <a href="http://www.itmarketer.com/" target="_blank"><font color="#006666">Ad Info</font></a> &nbsp;|&nbsp; <a href="/"><font color="#006666">Home</font></a></b>
		<br><br>
		
		Use of this site is subject to certain <a href="/agreement.html">Terms &amp; Conditions</a>, <a href="/copyright.html">Copyright &copy; 1996-1999 EarthWeb Inc.</a><br> 
All rights reserved.  Reproduction whole or in part in any form or medium without express written permision of EarthWeb is prohibited.</font><p>
</td>
		</tr>
</table>
</BODY>
</HTML>

<!-- END FOOTER -->

⌨️ 快捷键说明

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