Hi,
I've got a somewhat stupid question!
On WindowsCE 2.11:
The non-wide character versions of 'C' run time strings such _stricmp, strrchr etc are declared in <Windows.h> but I can't find an implmentation in any of the libs. Im currently porting a desktop app over and it uses a lot of single byte strings.
I've provided my own implementaions of the funtions I need, but im just wondering why they appear to be declared but not implemented. Any ideas?
Also, why does WindowsCE 2.11 SDK include headers for DirectX? If you have it installed, take a look at <DDraw.h> <D3d.h>. Weird!
Cheers,
-Zak
I had the same problems as well trying to use the FindFirstFile/FindNext api calls, they only have wide string versions, no ansi, never mind the ansi versions are declared as well.
In most cases, if you rely on the stdlib functions, count on them being wchar_t based. In my case, with evc4 with sp4, and an arm based device, nearly anything that deals with strings is wchar_t based. Kinda annoying since I've come from an ansi c background for almost all my previous work, but i suppose the non-english people need some love too =)
check your stdlib.h file, most of the str* functions have a wcs* equivalent.
Well, love it or loathe it, WindowsCE is predominately Unicode. It just seems strange that the functions are declared but not implemented.
What platform are you running on? It's possible to remove the implementation of the mbcs CRT functions via sysgen.
Also, DirectDraw was available in CE 2.12 via something called the DX Pak. It was a port of DirectDraw 6 (ish) from the desktop, which was already intertwined with D3D. So when I ported it, it was just easier to bring over the d3d header as well instead of trying to unwind it all. (Which we ended out doing in PPC/SP '05, anyway.)
I'm under WindowsCE 2.11 (HPC Pro 3.0, Eg: J680)
Have you any more info on the DX Pak? It's always been a bit difficult to support games under HPC's beacuse of the lack of any built-in/supported screen access API's.
Thanks.
DirectX Pak was only ever available for 2.12 and up, general embedded platforms only.
So, it turns out, that way back in the HPC 2.11 days, Windows CE realy was Unicode only: as you say, the MBCS variants of the CRT string routines were omitted for code space reasons.
Sorry I couldn't be more help.
gamefreaks wrote:Have you any more info on the DX Pak? It's always been a bit difficult to support games under HPC's beacuse of the lack of any built-in/supported screen access API's.
I used to own a Jornada 720, and blitting a 640x240 GDI bitmap (BitBlt) was just as fast as direct screen access. The issue was that the Jornada 720 has an external video controller with a low memory bandwidth, and no amount of direct access/assembly can fix that.
Updating only the pixels that change was even slower as the memory bandwith of the Joranda 720 was much lower then the one found on PPCs.
I used to own a Jornada 720, and blitting a 640x240 GDI bitmap (BitBlt) was just as fast as direct screen access. The issue was that the Jornada 720 has an external video controller with a low memory bandwidth, and no amount of direct access/assembly can fix that.
Updating only the pixels that change was even slower as the memory bandwith of the Joranda 720 was much lower then the one found on PPCs.
Yeh...still got the J720!!!
It was more compatibility than speed that is always the problem with HPC's. Though to be honest, I've never really bothered benchmarking the GDI functions, though presumably if your DIB is in the device's native format, it should be reasonably fast.
Use GDI, it's compatible, stable, and just as fast on HPCs.
Like you said, create a DIB with the same pixel format as the display and you are all set.