Digivation Hack Central

Using a Windows CE 4.20 SDK with VS2005 and VS2008

by on Nov.23, 2010, under WinCE

I have had the requirement to use a windows CE SDK with Visual Studio 2005 and 2008. This is desirable because they have better/newer ARM compilers, as well as being able to integrate a combined Native/.NET solution in 1 place for a single step build.

The hint on how to do this came after playing with Qt. Qt Comes with a program called checksdk. This little program comes with source which makes it easy to see what it is looking at to generate its -list output.

It uses the information in VC/vcpackages/WCE.VCPlatform.config. All that is needed is to add a Platform section at the end of this file. Reformatting is a good idea as all the Platform sections are on 1 line.

An example would look like

<Platform Name="VCProjectWCEPlatform.dll" Identifier="{8314598B-C36E-4C31-9C06-9A01D910AF28}">

 <Directories Include="$(VCInstallDir)ce\include;C:\Program Files\Windows CE Tools\wce420\Sample\include\ARMV4I;C:\Program Files\Windows CE Tools\wce420\Sample\include;$(VCInstallDir)ce\atlmfc\include;$(VSInstallDir)SmartDevices\SDK\SQL Server\Mobile\v3.0" Library="C:\Program Files\Windows CE Tools\wce420\Sample\lib\ARMV4I;$(VCInstallDir)ce\atlmfc\lib\ARMV4I;$(VCInstallDir)ce\lib\ARMV4I;" Path="$(VCInstallDir)\ce\bin\x86_arm;$(VCInstallDir)bin;$(VCInstallDir)PlatformSDK\bin;$(VSInstallDir)Common7\Tools;$(VSInstallDir)Common7\IDE;$(VSInstallDir)Common\Tools;$(VSInstallDir)Common\IDE;$(VSInstallDir);$(FrameworkSDKDir)Bin;$(PATH);" Reference="" Source=";$(VCInstallDir)ce\atlmfc\src\atl;$(VCInstallDir)ce\atlmfc\src\mfc;;$(VCInstallDir)ce\crt\src"/>

  <PlatformName>Sample (ARMV4I)</PlatformName>
    <Macro Name="_M_ARMT" Value=""/>
    <Macro Name="CEVER" Value="0x420"/>
    <Macro Name="ARCHFAM" Value="ARM"/>
    <Macro Name="_ARCHFAM_" Value="_ARM_"/>
    <Macro Name="INSTRUCTIONSET" Value="ARMV4I"/>
    <Macro Name="BINDIR" Value="$(VCInstallDir)ce\dll"/>

Make sure the 1st Guid is unique. The Guid in the SDKID must match that in the registry. Using regedit, open HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Tools\Platform Manager\{F384D888-F9AA-11D1-BB9E-00A0C9C9CCEE} and go through each subkey and and find the one in question. This subkey is the SDKID.

restarting VS will now show your WinCE4.2 platform when creating a smart device project. Deploy and debugging works AFAICT.
Also works with a Qt smart device project. You can also build Qt for WinCE 4.2 with a few patches which I will elaborate when time permits.

You also need to patch the 4.20 sdk due to build errors as follows:

--- a/Include/Armv4I/objidl.h 2003-03-21 10:13:20.000000000 +1100
+++ b/Include/Armv4i/objidl.h 2010-07-26 11:49:13.358544400 +1000
@@ -10701,7 +10701,7 @@
/* [uuid][object][local] */

-typedef /* [unique] */ __RPC_FAR *LPGLOBALINTERFACETABLE;
+typedef /* [unique] */ IGlobalInterfaceTable __RPC_FAR *LPGLOBALINTERFACETABLE;

EXTERN_C const IID IID_IGlobalInterfaceTable;
--- a/Include/Armv4I/shobjidl.h 2003-03-21 10:13:56.000000000 +1100
+++ b/Include/Armv4i/shobjidl.h 2010-07-26 12:42:24.317699600 +1000
@@ -1885,7 +1885,7 @@
// may or may not use those settings.
+typedef char* LPVIEWSETTINGS;

// NB Bitfields.
--- a/Include/Armv4I/kfuncs.h 2003-03-21 10:13:20.000000000 +1100
+++ b/Include/Armv4i/kfuncs.h 2010-07-27 10:43:33.127791200 +1000
@@ -115,7 +115,11 @@
#ifdef __cplusplus
extern "C" {
+#if _MSC_VER < 1300
void DebugBreak(void);
+#define DebugBreak() __debugbreak()
void __emit(unsigned const __int32);
#ifdef __cplusplus

Comments are closed.