Est. 2003 • Seattle, WA

PocketPC Controls

Computing History & Software Insights

eMbedded Visual C++ 4.0: The Definitive Development Environment

Master eMbedded Visual C++ 4.0, Microsoft's professional IDE for PocketPC and Windows CE development. Complete guide covering setup, debugging, and optimization.


eMbedded Visual C++ 4.0 (eVC4) was Microsoft’s professional-grade IDE for Windows CE and PocketPC development. Released as a free download, it enabled thousands of developers to create the essential applications that defined the platform.

Why eMbedded Visual C++?

Before Visual Studio 2005 added device support, eVC4 was the only option for serious native development:

FeatureeMbedded Visual C++eMbedded Visual Basic
PerformanceNative code, fastestInterpreted, slower
Memory ControlFull accessLimited
API AccessComplete Win32 subsetRestricted
DebuggingFull source debuggingBasic
CostFreeFree

For applications requiring speed—games, multimedia, system utilities—eVC4 was mandatory.

Installation and Setup

System Requirements

  • Windows 2000/XP Professional
  • 500 MB disk space (base)
  • 2+ GB with all SDKs
  • ActiveSync 4.x

SDK Installation Order

Proper SDK installation was critical:

  1. Install eMbedded Visual C++ 4.0 base
  2. Install Service Pack 4 (essential!)
  3. Install target platform SDKs:
    • Pocket PC 2003 SDK
    • Windows Mobile 5.0 SDK
    • Windows Mobile 6.0 SDK
Recommended SDK Locations:
C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\

Project Configuration

Creating a New Project

  1. File �New �Projects
  2. Select “WCE Pocket PC 2003 Application”
  3. Choose application type:
    • Hello World (basic window)
    • Dialog-based
    • Document/View (MFC-like)

Build Configurations

eVC4 supported multiple CPU targets from a single project:

PlatformProcessorNotes
ARMV4StrongARM, XScaleMost common
ARMV4IXScale optimizediPAQ hx4700
MIPSMIPS III/IVOlder devices
SH3/SH4HitachiJapanese market
x86EmulatorDesktop testing

Memory Management

Understanding Windows CE memory architecture was essential for eVC4 development:

The 32 MB Slot Limitation

Each process was limited to 32 MB virtual address space:

// Check available memory before large allocations
MEMORYSTATUS ms;
GlobalMemoryStatus(&ms);

if (ms.dwAvailPhys < REQUIRED_MEMORY) {
    // Handle low memory condition
    MessageBox(NULL, L"Insufficient memory", L"Error", MB_OK);
    return FALSE;
}

Memory Best Practices

  1. Release early: Free memory as soon as possible
  2. Use local allocations: Stack over heap when practical
  3. Memory-mapped files: Available in later CE versions
  4. Compress data: RAM was precious

Debugging Techniques

Remote Debugging

eVC4’s killer feature was seamless remote debugging:

  1. Connect device via ActiveSync
  2. Set breakpoints in source code
  3. Press F5 to deploy and debug
  4. Step through code on device

Variables, call stacks, and memory could be inspected exactly as on desktop.

Common Debugging Scenarios

// Debugging tip: Use RETAILMSG for release builds
RETAILMSG(1, (TEXT("Function entered: value=%d\r\n"), value));

// Debug-only assertions
ASSERT(pPointer != NULL);

// Platform detection
#ifdef _WIN32_WCE
    // Windows CE specific code
#else
    // Desktop code
#endif

Performance Optimization

Profiler Usage

eVC4 included a basic profiler for identifying bottlenecks:

  1. Build with profiling enabled
  2. Run application on device
  3. Analyze function timing
  4. Optimize hot paths

ARM Assembly

For maximum performance, inline assembly was available:

// ARM assembly example (XScale)
__inline int MultiplyAdd(int a, int b, int c) {
    int result;
    __asm {
        MLA result, a, b, c
    }
    return result;
}

The Dell Axim X51v’s Intel 2700G GPU could be accessed through DirectDraw for hardware-accelerated graphics.

MFC for Windows CE

eVC4 included a subset of MFC (Microsoft Foundation Classes):

Supported MFC Features

  • CWnd, CDialog, CView
  • CString, CArray, CList
  • Document/View architecture
  • Basic controls

Unsupported Features

  • Full OLE/COM support
  • Advanced print preview
  • Some container classes

Many developers preferred raw Win32 API for smaller executables and more control.

Tips and Tricks

Faster Build Times

// Precompiled headers are essential
#include "stdafx.h"  // Must be first include

// Minimize header dependencies
// Use forward declarations when possible
class CMyClass;  // Forward declaration

Resource Management

// Always pair allocations with deallocations
HBITMAP hBmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP));
// ... use bitmap ...
DeleteObject(hBmp);  // Don't forget!

Unicode Considerations

Windows CE was Unicode-only:

// Always use TCHAR and Unicode functions
TCHAR szBuffer[256];
_tcscpy(szBuffer, TEXT("Unicode string"));

// Never use char* or ANSI functions
// char* szBad;  // Won't work on CE

Migration to Visual Studio

After Visual Studio 2005, Microsoft integrated device development:

IDEWindows Mobile Support
eVC4WM 2003 - 5.0
VS 2005WM 5.0 - 6.0
VS 2008WM 6.0 - 6.5

For maintaining legacy projects, eVC4 remained relevant through 2010.

Resources