📄 403-405.html
字号:
<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=""> <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=15//-->
<!--PAGES=403-405//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch14/401-402.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="405-409.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 15<BR>Other Desktop Connectivity Topics
</FONT></H2>
<P><BIG><BIG>I</BIG></BIG>n the previous chapter we tackled the rather enormous subject of Windows CE data synchronization using the ActiveSync technology. While ActiveSync is perhaps the most important desktop connectivity feature of Windows CE, it is by no means the only connectivity feature.</P>
<P>In this chapter we will briefly introduce two additional components of the Window CE desktop connectivity landscape. The first of these is the Remote Application Programming Interface, commonly known as the Remote API or RAPI. The second is file filters, also known as file converters.</P>
<P>The subjects covered in this chapter are considerably more straightforward than data synchronization. You may well ask why these subjects were not covered first. As you will soon see, writing file filters involves some of the same steps as writing ActiveSync modules. For example, file filters have various registry entries that must be set, and file filters are implemented as COM servers. It is my feeling that once you have read and absorbed the material on ActiveSync programming, the subject of file filters will require much less discussion.</P>
<P>As for the Remote API, almost all of the functions that make up the API are related to Windows CE functions we have already covered in detail. You therefore already understand almost everything there is to know about RAPI. One feature common to both the Remote API and file filters is that they are both desktop PC phenomena. You only make Remote API calls from a desktop application. File filter DLLs are implemented for and reside on the desktop. Therefore, all of the code samples in this chapter are Windows NT code.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>AFTER COMPLETING THIS CHAPTER YOU WILL KNOW HOW TO …</B>
<DL>
<DD><B>Use the Remote API to access a Windows CE device from a desktop computer application</B>
<DD><B>Implement filters for converting files transferred between a desktop PC and a Windows CE device</B>
</DL>
<HR></FONT>
</BLOCKQUOTE>
<H3><A NAME="Heading2"></A><FONT COLOR="#000077">The Remote API</FONT></H3>
<P>The Windows CE Remote API provides a way for desktop PC applications to access a connected Windows CE device. This includes the ability to access the object store on the device, as well as to invoke functions residing in modules on the device. Data synchronization allows the desktop PC to access device data as well. But synchronization requires that device data be transferred to the desktop. With RAPI, a desktop application simply reads data from the device.
</P>
<P>The API includes functions for reading files or databases from the connected device. The API can also be used to read the registry of a Windows CE device. The desktop PC can also write to files, databases, or registry entries on the device.</P>
<P>Most of the Remote API functions are similar to Windows CE API functions we have already encountered. In many cases, the function names and arguments are exactly the same. For example, a Windows CE application opens a database in the object store by calling the Windows CE API <I>CeOpenDatabase</I>. A desktop application interested in accessing the same device database calls the RAPI function <I>CeOpenDatabase</I>.</P>
<P>Keep in mind that although the RAPI functions are similar or identical to their Windows CE counterparts, they are implemented in a library that resides on the desktop PC called RAPI.LIB. In short, the Remote API is a desktop PC feature for providing access to a remote device.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B><B>I<SMALL>NCLUDE</SMALL> RAPI.H <SMALL>AND</SMALL> L<SMALL>INK WITH</SMALL> RAPI.LIB</B>
<P><B>To use any of the Remote API functions, your application must include the header file RAPI.H. It must also link with the library RAPI.LIB.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<H3><A NAME="Heading3"></A><FONT COLOR="#000077">A RAPI Sample Application</FONT></H3>
<P>As with all other subjects in this book, an example is worth a few thousand words. The project files in \Samples\rapisamp build an application called RAPISAMP.EXE that looks very similar to the FILES.EXE application of Chapter 6. Throughout this discussion, keep in mind that this application is a Windows NT desktop application. User actions cause RAPISAMP.EXE to call RAPI functions. These RAPI function calls allow RAPISAMP.EXE to communicate with a connected Windows CE device.
</P>
<P>Figure 15.1 shows the RAPI sample application on the desktop PC. Expanding folders in the right-hand pane causes the application to read the contents of the corresponding directory on the connected Windows CE device. Tapping once on a folder forces the application to display the names of the files in the corresponding directory in the list view control pane on the right.</P>
<P><A NAME="Fig1"></A><A HREF="javascript:displayWindow('images/15-01.jpg',410,396 )"><IMG SRC="images/15-01t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/15-01.jpg',410,396)"><FONT COLOR="#000077"><B>Figure 15.1</B></FONT></A> The RAPI sample application.</P>
<P>Don’t be alarmed if you run this application and it does not display every file in a particular directory. Since RAPI calls are made across the serial connection to the device, they can be slow. The application therefore only displays 50 files or subdirectories for any one selected folder. This keeps the application from appearing to hang, which it might seem to do if it were to read every file from a large directory, such as the device Windows directory.
</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch14/401-402.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="405-409.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 + -