Tuesday, 12 October 2010

Missing Ordinals in Windows CE

If you get the message:

ERROR: function @ Ordinal 297 missing
Please Check your SYSGEN variable!!!


Then the problem is most likely to be a missing funciton in CoreDLL, to check which it is go to the private sources:

\WINCE600\PRIVATE\WINCEOS\COREOS\CORE\DLL>notepad core_common.def

In this you should be able to search for the ordinal number

; @CESYSGEN IF COREDLL_BATTERY
BatteryDrvrGetLevels=BatteryDrvrGetLevels @297
BatteryDrvrSupportsChangeNotification=BatteryDrvrSupportsChangeNotification @298
BatteryGetLifeTimeInfo=BatteryGetLifeTimeInfo @713
BatteryNotifyOfTimeChange=BatteryNotifyOfTimeChange @714
GetSystemPowerStatusEx=GetSystemPowerStatusEx @715
GetSystemPowerStatusEx2=GetSystemPowerStatusEx2 @1358
; @CESYSGEN ENDIF

Wednesday, 29 September 2010

Using events and waking devices using CeRunAppAtTime

Want to wake up a CE device at a future time (even if it is suspend), then use the CeRunAppAtTime but instead of running an app use a named event, this allows an application to wake up the device at a set time and also trap the wake event without spawning another process:

SYSTEMTIME time;
CTime nextWakeUpTime;

// get local system time and convert time to CTime for now
GetLocalTime(&time);
CTime now(time);

// 30 minutes in the future
nextWakeUpTime=now;
nextWakeUpTime+=CTimeSpan(0,0,30,0);

// convert to systemtime
nextWakeUpTime.GetAsSystemTime(time);

// set for wake up !
CeRunAppAtTime(TEXT("\\\\.\\Notifications\\NamedEvents\\SCHEDULE_WAKEEVENT_EVENT"), &time);

HANDLE wakeEvent = CreateEvent(NULL, FALSE, FALSE, SCHEDULE_WAKEEVENT_EVENT);

// wait for wake up!
if (WaitForSingleObject(wakeEvent, FALSE, INFINITE) == WAIT_OBJECT_0)
{
// sheduled wake up
}

Friday, 10 September 2010

KITL Messages Don't Support Wide Strings

I've just tracked down a minor irritation with KITL_RETAILMSG and KITL_DEBUGMSG under CE 6.0 R3 - they can't print UNICODE or wide strings.

On several platforms I've seen the KITL device name is not printed correctly. The device name is the name member of the OAL_KITL_DEVICE structure and is defined as a LPCWSTR.

Typically OALKitlInit uses KITL_RETAILMSG to report the device name but the name is never displayed correctly. The string is formatted as "%s" but only the first letter is shown - this implies that the wide string is being formatted as a character string. Trying %hs or %S to override the default does not help.

Reviewing the private sources confirms the problem. Only the %s format is supported and this is for character strings only.

Also be aware that formatting such as %08x is not supported either, but %X is fine!

Monday, 6 September 2010

Using #include from BIB files



Did you know that inside of Windows CE build system that bib files can #include other bib files. This technique is used on many BSP's to implement individual driver registry entries from the driver directory

platform.reg
#include "$(_TARGETPLATROOT)\SRC\DRIVERS\display\display.reg"

The same can be done for the bib file, I didn't release this before, but its there to use if you want to in CE6.0 for sure!

platform.bib
#include "$(_TARGETPLATROOT)\SRC\DRIVERS\display\display.bib"

Wednesday, 18 August 2010

Page faults on resume from suspend with COMPRESSION=on

A short while ago we had a problem on a platform resuming from suspend, a page fault calling a standard function. The function in question was a Registry query function. The fault was tracked down to that fact that when the config.bib specifies compression like:
COMPRESSION=ON
This means that all files are put into the nk.bin image back to back without any space between them, even running the image from RAM most of these files cannot be executed in place as the file aren't aligned on a page boundary, these files need to be copied into ram on a boundary and executed.
In the project above we needed to use the API so a solution was to turn off the COMPRESSION, this increases the NK.BIN size but helps in lower RAM usage and faster response times due to no duplication of files into executable positions. 

Thursday, 8 July 2010

Transformations in WindowsCE using SetMapMode

Unfortunately Windows CE doesn't support transformation of the coordinate system using SetMapMode, SetViewPortExt and SetWindowExt even in Windows CE 7.0 which is rather unfortunate as we had an application just this week that would have benefited from this. The application I'm referring to would have been cross compiled for Win32 and CE so basically I had to support scaling for the PC end as well, no point in having two different systems when the app should be seemless across both platforms, maybe in CE8.0 eh?

Wednesday, 9 June 2010

Windows CE 7.0 Preview

Microsoft have unveiled a technology preview of Windows Embedded Compact Edition (windows CE) version 7.0, the preview can be downloaded from http://www.microsoft.com/windowsembedded/en-us/products/windowsce/compact7.mspx go check it out now!