<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Digivation Hack Central &#187; WinCE</title>
	<atom:link href="http://blog.digivation.com.au/category/category/nifty-hacks/wince-hacks/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.digivation.com.au</link>
	<description>Tech Information about various subjects</description>
	<lastBuildDate>Sat, 17 Sep 2011 02:57:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Using a Windows CE 4.20 SDK with VS2005 and VS2008</title>
		<link>http://blog.digivation.com.au/category/nifty-hacks/wince-hacks/using-windows-ce-4-20-sdk-with-vs2005-and-vs2008</link>
		<comments>http://blog.digivation.com.au/category/nifty-hacks/wince-hacks/using-windows-ce-4-20-sdk-with-vs2005-and-vs2008#comments</comments>
		<pubDate>Tue, 23 Nov 2010 06:26:21 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[WinCE]]></category>

		<guid isPermaLink="false">http://blog.digivation.com.au/?p=171</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<p>The hint on how to do this came after playing with Qt. Qt Comes with a program<span id="more-171"></span><!--more--> called <strong>checksdk</strong>. This little program comes with source which makes it easy to see what it is looking at to generate its <strong>-list</strong> output.</p>
<p>It uses the information in <strong>VC/vcpackages/WCE.VCPlatform.config</strong>. All that is needed is to add a <strong>Platform</strong> section at the end of this file. Reformatting is a good idea as all the <strong>Platform</strong> sections are on 1 line.</p>
<p>An example would look like</p>
<p><code>&lt;Platform Name="VCProjectWCEPlatform.dll" Identifier="{8314598B-C36E-4C31-9C06-9A01D910AF28}"&gt;<br /> <br />
&nbsp;&lt;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"/&gt;<br /> <br />
&nbsp;&lt;PlatformData&gt;<br /> &nbsp; &lt;PlatformName&gt;Sample (ARMV4I)&lt;/PlatformName&gt;<br /> &nbsp; &lt;SDKID&gt;{F4B31E61-F19D-448C-AC87-FFBBDCE6748C}&lt;/SDKID&gt;<br /> &nbsp;  &lt;SupportsDCOM&gt;0&lt;/SupportsDCOM&gt;<br /> &nbsp; &lt;OSMajorVersion&gt;4&lt;/OSMajorVersion&gt;<br /> &nbsp; &lt;OSMinorVersion&gt;20&lt;/OSMinorVersion&gt;<br /> &nbsp; &lt;UISymbol&gt;STANDARDSHELL_UI_MODEL&lt;/UISymbol&gt;<br /> &nbsp; &lt;Macros&gt;<br /> &nbsp; &nbsp; &lt;Macro Name="_M_ARMT" Value=""/&gt;<br />&nbsp; &nbsp; &lt;Macro Name="CEVER" Value="0x420"/&gt;<br />&nbsp; &nbsp; &lt;Macro Name="ARCHFAM" Value="ARM"/&gt;<br /> &nbsp; &nbsp; &lt;Macro Name="_ARCHFAM_" Value="_ARM_"/&gt;<br /> &nbsp; &nbsp; &lt;Macro Name="INSTRUCTIONSET" Value="ARMV4I"/&gt;<br /> &nbsp; &nbsp; &lt;Macro Name="BINDIR" Value="$(VCInstallDir)ce\dll"/&gt;<br /> &nbsp; &lt;/Macros&gt;<br /> &nbsp;&lt;/PlatformData&gt;<br /> &lt;/Platform&gt;<br /> </code> </p>
<p>Make sure the 1st Guid is unique. The Guid in the SDKID must match that in the registry. Using <strong>regedit</strong>, open <strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Tools\Platform Manager\{F384D888-F9AA-11D1-BB9E-00A0C9C9CCEE}</strong> and go through each subkey and and find the one in question. This subkey is the <strong>SDKID</strong>.</p>
<p>restarting VS will now show your WinCE4.2 platform when creating a smart device project. Deploy and debugging works AFAICT.<br /> 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.</p>
<p>You also need to patch the 4.20 sdk due to build errors as follows:</p>
<p><code></p>
<blockquote><p>
--- a/Include/Armv4I/objidl.h     2003-03-21 10:13:20.000000000 +1100<br />
+++ b/Include/Armv4i/objidl.h 2010-07-26 11:49:13.358544400 +1000<br />
@@ -10701,7 +10701,7 @@<br />
 /* [uuid][object][local] */ </p>
<p>-typedef /* [unique] */ __RPC_FAR *LPGLOBALINTERFACETABLE;<br />
+typedef /* [unique] */ IGlobalInterfaceTable __RPC_FAR *LPGLOBALINTERFACETABLE;</p>
<p> EXTERN_C const IID IID_IGlobalInterfaceTable;<br />
--- a/Include/Armv4I/shobjidl.h   2003-03-21 10:13:56.000000000 +1100<br />
+++ b/Include/Armv4i/shobjidl.h       2010-07-26 12:42:24.317699600 +1000<br />
@@ -1885,7 +1885,7 @@<br />
 // may or may not use those settings.<br />
 //<br />
 //--------------------------------------------------------------------------<br />
-typedef LPVIEWSETTINGS;<br />
+typedef char* LPVIEWSETTINGS;</p>
<p> // NB Bitfields.<br />
 // FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL<br />
--- a/Include/Armv4I/kfuncs.h     2003-03-21 10:13:20.000000000 +1100<br />
+++ b/Include/Armv4i/kfuncs.h 2010-07-27 10:43:33.127791200 +1000<br />
@@ -115,7 +115,11 @@<br />
 #ifdef __cplusplus<br />
 extern "C" {<br />
 #endif<br />
+#if _MSC_VER < 1300<br />
 void DebugBreak(void);<br />
+#else<br />
+#define DebugBreak() __debugbreak()<br />
+#endif<br />
 void __emit(unsigned const __int32);<br />
 #ifdef __cplusplus<br />
 }
</p></blockquote>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digivation.com.au/category/nifty-hacks/wince-hacks/using-windows-ce-4-20-sdk-with-vs2005-and-vs2008/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using WinCE5.0 drivers on WinCE4.2</title>
		<link>http://blog.digivation.com.au/category/nifty-hacks/wince-hacks/using-wince5-0-drivers-on-wince4-2</link>
		<comments>http://blog.digivation.com.au/category/nifty-hacks/wince-hacks/using-wince5-0-drivers-on-wince4-2#comments</comments>
		<pubDate>Tue, 09 Feb 2010 04:17:01 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[WinCE]]></category>
		<category><![CDATA[device driver]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wince4.2]]></category>
		<category><![CDATA[wince5]]></category>

		<guid isPermaLink="false">http://blog.digivation.com.au/?p=62</guid>
		<description><![CDATA[Since wince 4.2 is quite old and not that well supported by OEM device manufacturers, it is often hard or impossible to get drivers for wince4.2 for these devices. However the API into coredll and other parts of the wince system libraries is, if not identical, then almost identical. I had an instance recently where [...]]]></description>
			<content:encoded><![CDATA[<p>Since wince 4.2 is quite old and not that well supported by OEM device manufacturers, it is often hard or impossible to get drivers for wince4.2 for these devices.</p>
<p>However the API into coredll and other parts of the wince system libraries is, if not identical, then almost identical.</p>
<p>I had an instance recently where I needed to make a USB wifi device work with wince4.2. After doing some research, I chose a ralink 2471W based device. However it came with a wince5 driver. Binary only of course.</p>
<p>Looking at the driver dll, all the imported functions were available except 1 in the ndis.dll, that being NdisQueryPacket. In wince4.2, this fucntion is provided by a #define, but in wince5 it is a instantiated function.</p>
<p>The solution is to compile the following code to an obj, and use the lib32 to add it to ndislib.lib in the private tree.</p>
<blockquote><p><code><br />
// local modded copy of ndis.h<br />
#include "ndis.h"<br />
#include &lt;pkfuncs.h&gt;<br />
</code></p>
<p>VOID<br />
NdisQueryPacket(<br />
IN  PNDIS_PACKET            _Packet,<br />
OUT PUINT                   _PhysicalBufferCount OPTIONAL,<br />
OUT PUINT                   _BufferCount OPTIONAL,<br />
OUT PNDIS_BUFFER *          _FirstBuffer OPTIONAL,<br />
OUT PUINT                   _TotalPacketLength OPTIONAL<br />
)<br />
{<br />
NdisQueryPacketDef(_Packet, _PhysicalBufferCount, _BufferCount, _FirstBuffer, _TotalPacketLength);<br />
}</p></blockquote>
<p>Also add the export definition to the end of ndis.def so that it becomes exported when ndis.dll is built with the system.</p>
<p>Finally, remember to put these 2 files back in the private tree where you got them from.</p>
<p>Now when the system is rebuilt with platform builder, the new ndis.dll will contain this extra function, thus allowing the USB wifi driver to function perfectly without modification.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digivation.com.au/category/nifty-hacks/wince-hacks/using-wince5-0-drivers-on-wince4-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

