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:
| Feature | eMbedded Visual C++ | eMbedded Visual Basic |
|---|---|---|
| Performance | Native code, fastest | Interpreted, slower |
| Memory Control | Full access | Limited |
| API Access | Complete Win32 subset | Restricted |
| Debugging | Full source debugging | Basic |
| Cost | Free | Free |
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:
- Install eMbedded Visual C++ 4.0 base
- Install Service Pack 4 (essential!)
- 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
- File �New �Projects
- Select “WCE Pocket PC 2003 Application”
- Choose application type:
- Hello World (basic window)
- Dialog-based
- Document/View (MFC-like)
Build Configurations
eVC4 supported multiple CPU targets from a single project:
| Platform | Processor | Notes |
|---|---|---|
| ARMV4 | StrongARM, XScale | Most common |
| ARMV4I | XScale optimized | iPAQ hx4700 |
| MIPS | MIPS III/IV | Older devices |
| SH3/SH4 | Hitachi | Japanese market |
| x86 | Emulator | Desktop 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
- Release early: Free memory as soon as possible
- Use local allocations: Stack over heap when practical
- Memory-mapped files: Available in later CE versions
- Compress data: RAM was precious
Debugging Techniques
Remote Debugging
eVC4’s killer feature was seamless remote debugging:
- Connect device via ActiveSync
- Set breakpoints in source code
- Press F5 to deploy and debug
- 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:
- Build with profiling enabled
- Run application on device
- Analyze function timing
- 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:
| IDE | Windows Mobile Support |
|---|---|
| eVC4 | WM 2003 - 5.0 |
| VS 2005 | WM 5.0 - 6.0 |
| VS 2008 | WM 6.0 - 6.5 |
For maintaining legacy projects, eVC4 remained relevant through 2010.