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

📄 209-211.html

📁 WindowsCE.[Essential Windows CE Application Programming].Jon Wiley & Son.zip
💻 HTML
📖 第 1 页 / 共 2 页
字号:
			<option value="/reference/dir.userinterfaces.html">UI
			<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=209-211//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="207-209.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="211-214.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>Before looking at the <I>dwSeekType</I> parameter more closely, it is important to point out some characteristics of the seek operation. First, <I>CeSeekDatabase</I> searches a database in the order specified by the current sort order. Second, a seek can only be performed on a sorted property value. This means that if you are calling <I>CeSeekDatabase</I> to search for some record by value, the value specified in the <I>dwValue</I> parameter will only be compared to the database property values that correspond to the current sort order property. Recall these points when tracking down bugs in your database searching code. Programmers just starting to use Windows CE databases make the common mistake of searching for a record containing a particular property when the database is sorted on a different property.</P>
<P><I>dwSeekType</I> can be one of the following values:</P>
<DL>
<DD><B>&#149;</B>&nbsp;&nbsp;CEDB_SEEK_CEOID
<DD><B>&#149;</B>&nbsp;&nbsp;CEDB_SEEK_VALUESMALLER
<DD><B>&#149;</B>&nbsp;&nbsp;CEDB_SEEK_VALUEFIRSTEQUAL
<DD><B>&#149;</B>&nbsp;&nbsp;CEDB_SEEK_VALUENEXTEQUAL
<DD><B>&#149;</B>&nbsp;&nbsp;CEDB_SEEK_VALUEGREATER
<DD><B>&#149;</B>&nbsp;&nbsp;CEDB_SEEK_BEGINNING
<DD><B>&#149;</B>&nbsp;&nbsp;CEDB_SEEK_CURRENT
<DD><B>&#149;</B>&nbsp;&nbsp;CEDB_SEEK_END
</DL>
<P>CEDB_SEEK_CEOID implies that <I>dwValue</I> is the object identifier of the record to seek in the database. At first glance, this case might not appear to be particularly useful. If an application already knows the object identifier of the record it is seeking, why would a seek even need to be done? It is important to keep in mind that <I>CeSeekDatabase</I> repositions the current record pointer, which indicates which record will be read from the database by the next read operation. So, if the phone list application wanted to read the properties of the record with an object identifier defined as <I>ceoid</I>, the application would first have to seek to that record, and then read the record from the database:</P>
<!-- CODE //-->
<PRE>
   WORD cProps = 0;
   LPBYTE pBuf = NULL;
   DWORD cbByte = 0;
   if (CeSeekDatabase(hDBase, CEDB_SEEK_CEOID, (DWORD)ceoid,
     &#38;nIndex))
   &#123;
     CeReadRecordProps(hBase, CEDB_ALLOWREALLOC, &#38;cProps, NULL,
      &#38;pBuf,&#38;cbByte);
   &#125;
</PRE>
<!-- END CODE //-->
<P>Calling <I>CeSeekDatabase</I> alone will simply point the current record pointer at the record of interest.</P>
<P>The next four <I>dwSeekType</I> values indicate that <I>dwValue</I> is a pointer to a CEPROPVAL structure that contains the property value for which to seek. CEDB_SEEK_VALUESMALLER says to search the database for the largest value that is smaller than the given value. CEDB_SEEK_ VALUEFIRSTEQUAL tells <I>CeSeekDatabase</I> to search until it finds the first value equal to that indicated by <I>dwValue</I>. CEDB_SEEK_VALUENEXTEQUAL seeks one record forward from the current record position and checks if the property value of that record equals that of <I>dwValue</I>. CEDB_SEEK_VALUEGREATER seeks until a record with current sort order property equal to or greater than that of <I>dwValue</I> is found. If <I>CeSeekDatabase</I> fails with any of these four <I>dwSeekType</I> values, the function returns zero and leaves the current record pointer at the end of the database.</P>
<P>If you know the index of the record you are seeking in the database, the CEDB_SEEK_BEGINNING option is the one to use. For example, the user interface of the phone list application displays the phone database, sorted by the current sort order, in a list view control. It is convenient to locate the database record corresponding to the current list view selection by 0-based index. Specifying CEDB_SEEK_BEGINNING for <I>dwSeekType</I> implies that <I>dwValue</I> is the number of records to seek, that is, the zero-based index of the database record in the current sort order to be retrieved.</P>
<P>CEDB_SEEK_CURRENT moves the current record pointer forward or backward from the current record position the number of records specified by <I>dwValue</I>. If <I>dwValue</I> is positive, <I>CeSeekDatabase</I> seeks forward. The search is backward if <I>dwValue</I> is negative. CEDB_SEEK_ END is similar, except that it always seeks backward from the end of the database. It moves the current record pointer backward the number of records specified in <I>dwValue</I>.</P>
<P>In any of the above cases, if <I>CeSeekDatabase</I> is successful, it returns the object identifier of the record pointed to by the current record pointer.</P>
<P>The phone list application&#146;s Seek menu option brings up a dialog box that allows you to experiment with the <I>CeSeekDatabase</I> function. It allows you to specify various <I>dwSeekType</I> parameter values as well as property values for which to search. The application then displays the record found in the application window in the Search Results field. In the interest of keeping the phone list application to a reasonable size, this feature only allows you to specify <I>dwSeekType</I> values that perform database seeks by value.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="207-209.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="211-214.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 + -