📄 182-184.html
字号:
<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=""> <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=6//-->
<!--PAGES=182-184//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="178-182.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch07/185-189.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B>Flash Card APIs</B></FONT></P>
<P>There are some additional functions provided by Windows CE for enumerating flash cards and files on flash cards. Use of these functions is very similar to their file system API counterparts.
</P>
<P><FONT SIZE="+1"><B><I>Enumerating Flash Cards</I></B></FONT></P>
<P>The first set of flash card API functions is used to enumerate flash cards or other mountable file systems attached to a device.
</P>
<P>The first of these functions is <I>FindFirstFlashCard</I>. This function is used to find the first flash card (or other mountable file system) on a device:</P>
<!-- CODE SNIP //-->
<PRE>
FindFirstFlashCard(lpFindFlashData);
</PRE>
<!-- END CODE SNIP //-->
<P>The only parameter to this function is a pointer to a WIN32_FIND_ DATA structure. This function is analogous to <I>FindFirstFile</I>. The difference is that instead of returning WIN32_FIND_DATA information about the first specified file or directory, it returns information about the first flash card it finds.</P>
<P>The most important piece of information <I>FindFirstFlashCard</I> returns is the object identifier of the flash card. This value is returned in the <I>dwOID</I> member of the <I>lpFindFlashData</I> parameter.</P>
<P>Also like <I>FindFirstFile</I>, <I>FindFirstFlashCard</I> returns a search handle that can be used to perform searches for additional flash cards. Additional flash cards can be found with subsequent calls to <I>FindNextFlashCard</I>:</P>
<!-- CODE SNIP //-->
<PRE>
FindNextFlashCard(hFlashCard, lpFindFlashData);
</PRE>
<!-- END CODE SNIP //-->
<P><I>hFlashCard</I> is the search handle returned by <I>FindFirstFlashCard</I>. <I>lpFindFlashData</I> is a WIN32_FIND_DATA structure pointer containing information about the next flash card.</P>
<P>Note that it is not common for a Windows CE–based device to contain more than one flash card.</P>
<P>Flash card search handles, like file search handles, are closed with the <I>FindClose</I> function.</P>
<P><FONT SIZE="+1"><B><I>Searching for Flash Card Files</I></B></FONT></P>
<P>The second set of flash card API functions is used to enumerate files and directories stored on flash cards.
</P>
<P><I>FindFirstProjectFile</I> is the same as <I>FindFirstFile</I> except that it can be made to look for files on a specified mountable file system:</P>
<!-- CODE SNIP //-->
<PRE>
FindFirstProjectFile(lpFileName, lpFindFileData,
dwOidFlash, lpszProj);
</PRE>
<!-- END CODE SNIP //-->
<P>The first two parameters of this function are the same as in <I>FindFirstFile.</I> They contain the file or directory name to search for and the returned WIN32_FIND_DATA, respectively.</P>
<P><I>dwOidFlash</I> identifies the storage card to search on. This value is obtained by a previous call to <I>FindFirstFlashCard</I> or <I>FindNextFlashCard</I>. This parameter can be set to zero, in which case the main device file system is searched instead of a mountable file system. <I>FindFirstProjectFile</I> can thus be used just like <I>FindFirstFile</I> on devices that include mountable file systems. In fact, it is recommended that on devices such as the Palm-size PC, <I>FindFirstProjectFile</I> be used exclusively.</P>
<P>The final parameter, <I>lpszProj</I>, indicates the folder to start the search in. If NULL, the search starts with the \My Documents folder.</P>
<P><I>FindFirstProjectFile</I> returns a search handle, just like <I>FindFirstFile</I>. This search handle is used to perform subsequent searches with the <I>FindNextProjectFile</I> function:</P>
<!-- CODE SNIP //-->
<PRE>
FindNextProjectFile(hHandle, lpFindProjData);
</PRE>
<!-- END CODE SNIP //-->
<P>The parameters and behavior of this function are the same as <I>FindNextFile</I>.</P>
<H3><A NAME="Heading14"></A><FONT COLOR="#000077">Concluding Remarks</FONT></H3>
<P>That’s it for the Windows CE file system. You should now be able to add file support to your Windows CE applications in order to store and retrieve data. But more often you will want to store and organize information in a more structured format than a simple flat data file. For this purpose, Windows CE provides a simple database technology. Windows CE databases are the subject of the next chapter.
</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="178-182.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch07/185-189.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> | <a href="/contactus.html"><font color="#006666">Contact Us</font></a> | <a href="/aboutus.html"><font color="#006666">About Us</font></a> | <a href="http://www.earthweb.com/corporate/privacy.html" target="_blank"><font color="#006666">Privacy</font></a> | <a href="http://www.itmarketer.com/" target="_blank"><font color="#006666">Ad Info</font></a> | <a href="/"><font color="#006666">Home</font></a></b>
<br><br>
Use of this site is subject to certain <a href="/agreement.html">Terms & Conditions</a>, <a href="/copyright.html">Copyright © 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 + -