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

📄 007-013.html

📁 WindowsCE.[Essential Windows CE Application Programming].Jon Wiley & Son.zip
💻 HTML
📖 第 1 页 / 共 2 页
字号:
			</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=1//-->
<!--PAGES=007-013//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="005-007.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="013-016.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B><I>Building for Emulation</I></B></FONT></P>
<P>The first step in building a Windows CE application for any target is to open the workspace file for that application. Choose the Open Workspace option from the Microsoft Developer Studio File menu (Figure 1.1). From the Open Workspace dialog, find and open the file TEMPLATE.DSW (Figure 1.2).
</P>
<P><A NAME="Fig1"></A><A HREF="javascript:displayWindow('images/01-01.jpg',224,236 )"><IMG SRC="images/01-01t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-01.jpg',224,236)"><FONT COLOR="#000077"><B>Figure 1.1</B></FONT></A>&nbsp;&nbsp;The Open Workspace menu option.</P>
<P><A NAME="Fig2"></A><A HREF="javascript:displayWindow('images/01-02.jpg',425,263 )"><IMG SRC="images/01-02t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-02.jpg',425,263)"><FONT COLOR="#000077"><B>Figure 1.2</B></FONT></A>&nbsp;&nbsp;Opening the Workspace file.</P>
<P>You must now specify which <I>configuration</I> to build the application for. This is done by making a selection from the combo box shown in Figure 1.3. You can specify whether to build TEMPLATE.EXE for the debug emulation environment. Or you can build the release or debug versions of the application for any of the processors for which you have installed compilers. As we want to build for debug emulation, select the &#147;Win32 (WCE x86em) Debug&#148; option.</P>
<P><A NAME="Fig3"></A><A HREF="javascript:displayWindow('images/01-03.jpg',239,138 )"><IMG SRC="images/01-03t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-03.jpg',239,138)"><FONT COLOR="#000077"><B>Figure 1.3</B></FONT></A>&nbsp;&nbsp;Selecting a target build configuration.</P>
<P>If you have installed more than one Windows CE Platform SDK, a second combo box will be included in the Developer Studio toolbar which lets you select the product to build for. For this example, make sure you pick a Handheld PC version.
</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B><B>W<SMALL>HAT</SMALL> I<SMALL>F</SMALL> I D<SMALL>ON&#146;T</SMALL> S<SMALL>EE THE</SMALL> C<SMALL>ONFIGURATION</SMALL> C<SMALL>OMBO</SMALL> B<SMALL>OX</SMALL>?</B>
<P><B>If the configuration combo box does not appear somewhere in the Developer Studio toolbar, you may need to add it manually. Select the Customize&#133; option from the Tools menu. Then click on the Commands tab. From the Category combo box, select Build. The Buttons group will include the configuration combo box. Simply drag it to your toolbar and drop it where you want it.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<P>Now that you have specified the configuration to build, build the application by choosing the Rebuild All option from the Build menu. The application will compile and link. During the link phase, the Handheld PC emulation environment will start up (Figure 1.4). This simulates a real Handheld PC shell.</P>
<P><A NAME="Fig4"></A><A HREF="javascript:displayWindow('images/01-04.jpg',480,240 )"><IMG SRC="images/01-04t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-04.jpg',480,240)"><FONT COLOR="#000077"><B>Figure 1.4</B></FONT></A>&nbsp;&nbsp;The Handheld PC emulation environment.</P>
<P>Now you can run and debug the application just as you would any other Windows application. When you run the TEMPLATE.EXE application in the emulator, you should see something like Figure 1.5.
</P>
<P><A NAME="Fig5"></A><A HREF="javascript:displayWindow('images/01-05.jpg',480,240 )"><IMG SRC="images/01-05t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-05.jpg',480,240)"><FONT COLOR="#000077"><B>Figure 1.5</B></FONT></A>&nbsp;&nbsp;Running an application in the emulation environment.</P>
<P><FONT SIZE="+1"><B><I>Building for a Real Device</I></B></FONT></P>
<P>Building an application for a real Windows CE device configuration is similar to building for the emulator. The differences come in when it&#146;s time to transfer the executable image from the desktop PC to the hardware.
</P>
<P>Let&#146;s say you want to build the release version of TEMPLATE.EXE for a Handheld PC running on an SH3 processor. You simply select &#147;Win32 (WCE SH) Release&#148; from the configuration combo box and rebuild the application (see Figure 1.3).</P>
<P>Now you have to get the application to the Handheld PC. Assuming that you have already connected your Handheld PC to the desktop computer, open the Mobile Devices folder on the desktop PC. You will see a window that looks something like the one in Figure 1.6. The name of the Handheld PC icon will be whatever name you gave your device when you configured it.</P>
<P><A NAME="Fig6"></A><A HREF="javascript:displayWindow('images/01-06.jpg',409,214 )"><IMG SRC="images/01-06t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-06.jpg',409,214)"><FONT COLOR="#000077"><B>Figure 1.6</B></FONT></A>&nbsp;&nbsp;The Mobile Devices folder.</P>
<P>Double-click on the icon corresponding to your Windows CE device, and a window similar to that in Figure 1.7 will appear. This window shows the contents of your Handheld PC desktop.
</P>
<P><A NAME="Fig7"></A><A HREF="javascript:displayWindow('images/01-07.jpg',484,249 )"><IMG SRC="images/01-07t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-07.jpg',484,249)"><FONT COLOR="#000077"><B>Figure 1.7</B></FONT></A>&nbsp;&nbsp;A Handheld PC desktop displayed by mobile devices.</P>
<P>To copy the TEMPLATE.EXE image to your Handheld PC, open Windows NT Explorer and drag the executable you just built to the desired location on the Handheld PC. To place it on the desktop, drop the file in the desktop window shown in Figure 1.7. To copy the file to the Windows directory, double-click the My Handheld PC icon in the Mobile Devices window displaying your Handheld PC desktop. Several folders, including the Windows folder, will appear. Drag and drop TEMPLATE.EXE to the Windows folder.
</P>
<P><FONT SIZE="+1"><B><I>Debugging on the Windows CE Device</I></B></FONT></P>
<P>Now that you have successfully built a Windows CE application and downloaded it to your Handheld PC, let&#146;s take a quick look at how to remotely debug the application using the Visual C&#43;&#43; debugger.
</P>
<P>Using the debugger is the same for remote applications as it is for traditional desktop applications, or Windows CE applications running under emulation. But you must first perform a few preliminary steps.</P>
<P>The first step is to build the application in question for the debug, instead of the release, configuration for the target processor. Next, this debug version of the application must be downloaded to the device. To do this, select the Update Remote Output File option from the Developer Studio Build menu.</P>
<P>After that, you can set break points and debug the application just as you would a Windows NT or Windows 98 application.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B><B>A<SMALL>UTOMATIC</SMALL> D<SMALL>OWNLOADING</SMALL></B>
<P><B>It is possible to have Microsoft Developer Studio automatically download release and debug application images. If you select the Always Download option from the Build menu, compiled executables are downloaded to the appropriate target automatically. This also includes &#147;downloading&#148; applications to the emulation object store.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<P><FONT SIZE="+1"><B>Other Tools</B></FONT></P>
<P>There are many other development tools that can be used for Windows CE programming. For example, the Windows CE Toolkits include Spy, a process viewer, and a heap walker, to name a few. These tools are not covered in this book. Readers are referred to the on-line documentation for details on using the other Windows CE development tools.
</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="005-007.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="013-016.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 + -