Microsoft KB Archive/264038

= How To Install and Use Visual C++ 6.0 Debugger with Windows CE 2.11 Target Devices =

Article ID: 264038

Article Last Modified on 3/9/2005

-

APPLIES TO


 * Microsoft Windows CE 2.11 for the Handheld PC

-



This article was previously published under Q264038



SUMMARY
There are a number of options for debugging applications on Windows CE target devices including Windbg, PlatformBuilder (PB) IDE debugger, and Visual C++ (VC++) IDE debugger. This article explores the details of setting up and using the Visual C++ IDE debugger.



MORE INFORMATION
The following steps take you through the set up and usage of the Visual C++ 6.0 debugger to debug an application developed for a Windows CE target device. You do not need any other debug services like eshell, ceterm, or Windbg.

Prerequisites:


 * Microsoft Windows CE Platform Builder version 2.11.
 * Microsoft Visual C++ 6.0.
 * Microsoft Windows CE Toolkit for Visual C++ 6.0.
 * Microsoft Windows NT 4.0 with Service Pack 4 or later.
 * An x86 (CEPC) target device.
 * A bi-directional parallel port (for downloading).
 * A compatible product ethernet adapter (for debugging).
 * An optional serial port (for watching debug messages).

 Open a build window for your platform (for example, CPEC-Maxall). Before you invoke the Build window, make sure that the build icon's properties are similar to: C:\WINNT\system32\CMD.EXE /k C:\WINCE211\public\common\oak\misc\wince.bat x86 i486 CE MAXALL CEPC

 Set the environment variable CEPC_NE2000_ISA=1. This specific environment variable value is for an ISA based network card; yours may be different. For more information, refer to the &quot;environment variables&quot; topic in the Platform Builder Online documentation.  Make sure that the ...\release\platform.reg file is updated with the net card interrupt and IO base address as follows: [HKEY_LOCAL_MACHINE\Comm\NE20001\Parms] &quot;BusNumber&quot;=dword:0 &quot;BusType&quot;=dword:1 &quot;InterruptNumber&quot;=dword:0B     ; change this to your hex interrupt &quot;IoBaseAddress&quot;=dword:240      ; change this to your hex base address  At the Build window navigate to the release directory and run the makeimg command. Do not do a full build or you will overwrite the platform.reg changes you made.  At the Build window, to open a CESH window, type: start cesh -p cepc nk.bin   At a DOS prompt on the CEPC target, type: loadcepc /b:38400 /c:1 /d:2 /p nk.bin You will see progress bars on the CEPC target and in the CESH window during the download. You should then see a Windows CE> prompt in the CESH window. Your operating system is now running.

 Run Platform Builder 2.11. To open Platform Builder, follow these steps: <ol style="list-style-type: lower-alpha;"> From the Build menu, click Export SDK ... and then click Maxall211.exe (Maxall211.exe is a self-extracting EXE file).</li> Select a directory in which you will store the SDK, and then follow the remaining instructions.</li></ol>

After the export, run the program to install all the DLL files and Include files for your platform into the Visual C++ environment.

NOTE: This step is performed only once per installation. After you complete this step, your Visual C++ menus are updated and you can connect to your target platform.

</li> Click the Test button. An animated cable between a workstation and a target is displayed. When the connection has been established, the following message appears:

Connection to device established.

Select OK in all the dialog boxes until you return to the main Visual C++ user interface.</li> To download the EXE file you built to your target, from your Visual C++ Build menu, click Update Remote Output File. You can now use the IDE debugger from Visual C++. A debug toolbar appears after debugging starts.</li></ol>

NOTE: This debugger configuration is very slow. Each single-step in the debugger takes about 10-15 seconds to run and return. This is due to how the cemon.exe file (the agent that handles debug interactions with the workstation) handles page exceptions. This is a known problem.

<div class="references_section">