Introduction

CeLib is a collection of classes that are a cross between ATL and MFC Window classes with some additional functionality thrown in to get some of the functionality you get from MFC (string, network and UI).

I first started programming for Windows CE version 2.0 for HPC and 2.01 for Palm-sized PC. The only tools, available were a Visual Studio 5.0 plugin for C++ and a Visual Basic plugin for 5.0. MFC was avialble for the 2.0 HPC platform, but not for 2.01 Palm-sized PC, in addition it was a 300+ K additional installation and wasn't yet included on most ROMs. I needed to write applications that would run on both so MFC and ATL were out. So I looked at the source for MFC and ATL and some other window class library and stole the ideas and wrote my own.

An application with significant functionality can be created in 20k. The database browser that is included is about 50k and requires no DLLs that aren't already installed.

Version Information

These libraries will build for operating system versions 2.0, 2.01 and 2.11. They have been tested and work on HPC 2.0, Palm-sized PC 1.0, Palm-sized PC 1.2, HPC Pro 3.0, and PocketPC in compatibilty mode.

Some important files

CePlatform.h

Compile time defines to make life easier for version differences in library includes all libraries required for COM and normal Window functionality. Library names are different across different version of CE as well as between the emulator and non-emulator versions, this header hides those differences.

Also note that in Windows CE, many library functions from Windows 95/NT like WINSOCK and TAPI are included in the standard libraries, NOT in a special libraries.

CeDebug.h

Debug support such as TRACE, ASSERT

CeMisc.h

Miscellaneous helper classes

Class Descriptions

String

CeString

reference counted string class, CString plus numeric conversion

User Interface

CeBaseWnd

A wrapper around HWND that provides for windows calls, but does not handle messages at all.

CeMsgWnd

Message Handling for any class through multiple inheritance.

CeWnd

Derived from both CeBaseWnd and CeMsgWnd to create the functionality of CWindowImpl (ATL) or CWnd (MFC), a basic Window wrapper

CeCmdBar

Wrapper class for CE command bars

CeCombo

Wrapper class for comboboxes

CeSplitFrame

Frame Splitter class

CeTabCtrl

Tab control wrapper

CDialogScroll

Dialog with scroll bars

CeStatic

Static control wrapper

CeChildMgr

A class for managing child window positioning within a common parent

CePropertySheet

Property sheet wrapper

CePropertyPage

Property page wrapper

CeDialog

Dialog wrapper class

CeFontDlg

Font chooser dialog wrapper

CeStaticGroup

Group box class

Modules, Control and Threads

CeCriticalSection

CRITICALSECTION wrapper

CeWaitableHandle

HANDLE wrapper with WaitForXXXXObject() support

CeManualEvent

Manual Reset EVENT class

CeAutoEvent

Auto Reset EVENT class

CeWaitObjects

A class for constructing a list of object that can be waited for in concert (WaitforMultipleObjects, MsgWaitforMultipleObjects, etc)

CeWorkerThread

Thread wrapper class

CeAppModule

wrapper for an application's instance

Network

CeSocket

Socket wrapper classes

CeSockAddr

Socket Address (SOCKADDR) wrapper

CeFtpClient

FTP client class, a native implementation on the CeSocket class

Operating System

CeFindFile

FindFile wrapper

CeRegKey

Registry API wrapper

CeResource

Simple Resource access

CeVersionInfo

Version info extraction

Utility

CeArray

Simple array class

CeSimpleMap

Simple map (hashtable) class

CeRect

RECT wrapper class

CePoint

POINT wrapper class

Database

CeDb

CE native database support

Experimental

CeInkCtrl

Wraps the Ink control

CeRichInkCtrl

Wraps the Rich Ink control

CeRas

RAS API wrapper

CeToolTip

Tooltip class

History

Oct 5 2000 - Updated with both functional and PocketPC support changes.

CeDbRecord doesn't properly copy over existing CEVT_LPWSTR and CEVT_BLOB values. After copying the properties array, it just shuffles up the data pointed to by the pProps[ii].val.blob.lpb or pProps[ii].val.lpwstr members. These still point to addresses in the old buffer. The pointer arithmetic for LPWSTR's is also not right.

I've only used CeArray and CeString, but there are problems in each that might nip you in the butt.

CeString: Format() is not safe! I replaced it with the Format() from MFC CString which calculates the size of the buffer needed before doing a vsprintf.

CeArray: The destructor does not call the destructors for all the elements it contains. This is done in MFC classes with a DestructElements() call. I simply made a new function for CeArray called RemoveAll().

I am having trouble with doing a FileInfo, and the file not existing. Basically the program appears to go into a wait, and does not come back with false. I have set my timeouts to 5 seconds, but it does not seem to help.

I have two questions. I am trying to implement a file distribution component for a large number of handhelds (currently using Symbol PPT2700's). This is basically an ftp client I have based on the CeFtpClient class. I am not familiar with the FTP protocol, and I haven't bothered checking the RFC, but I noticed that if I just connect to a server and request a file without requesting a directory listing first, it just times out and I get a zero byte file on the device. It's not a big deal, just a curiosity.

My other question is a problem. If I have two clients connected w/downloads in progress, and a third connects, it cannot download anything. It times out on the switch(select(...)) statement on line 228 of CeSocket.cpp. Any ideas? I have tried passive and non passive and neither works. If I connect with another PC using the command line MS FTP client as the third connection, it works fine. The server is a Win2k Pro box on a test network w/max anon users at the default of 10.

I implemented RichInkCtrl in my project running on PPC. It works fine. Now my problem is to transfer PWI data
to the desktop and view it in my own program. Is there a quick way to review PWI data in my application running
on the desktop? Filtering PWI to RTF causes the pen writing and sound to be not accessible.
Wlodek

WaitForMultipleObjects has a bug in windows ce 2.11.
In some conditions when a thread waits for some events
it can happen that the function call never returns.
I have seen that in my own application and was searching
the bug about one week.
It is better too use a workaround with WaitForSingleObject.