tag:blogger.com,1999:blog-2130913259401535772024-03-20T09:37:42.861+00:00CE4ALL Windows CE Team BlogHints, tips and discoveries about all versions of Windows CEGraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.comBlogger81125tag:blogger.com,1999:blog-213091325940153577.post-79892886708504715182013-04-17T15:30:00.000+00:002013-04-17T15:30:36.484+00:00Disabling Visual Studio macro “tip” balloonThanks to Stack Overflow for showing how to get rid of the annoying tip balloon when running macros in Visual Studio.<br />
<br />
<a href="http://stackoverflow.com/questions/48470/how-to-disable-visual-studio-macro-tip-balloon" target="_blank">http://stackoverflow.com/questions/48470/how-to-disable-visual-studio-macro-tip-balloon</a><br />
<br />
The key is to create/set the "DontShowMacrosBalloon" value to dword:6 under [HKCU\Software\Microsoft\VisualStudio\9.0] etc.<br />
<br />
Respect to these guys as this has been annoying me for ages...<br />
<br />
MartinT<br />
MartinThttp://www.blogger.com/profile/11857650368898665976noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-21297010633958436272012-11-29T15:25:00.001+00:002012-11-29T15:25:47.416+00:00Update to Removing Process & Thread IDs from WEC 7.0 Serial Debug Output<span style="font-family: Verdana, sans-serif;">Following my earlier post I've found that setting</span><br />
<span style="font-family: Verdana, sans-serif;"> </span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;"> g_pOemGlobal->pfnWriteDebugString = NULL;</span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana, sans-serif;">has an unfortunate side-effect during suspend & resume in that any debug prints during OEMPowerOff will use the NULL function pointer and cause the system to crash.</span><br />
<span style="font-family: Verdana;"></span><br />
<span style="font-family: Verdana;">The solution is to restore the kernel to use the default serial debug during OEMPowerOff()...</span><br />
<span style="font-family: Verdana;"></span><br />
<span style="font-family: Verdana;"><span style="font-family: "Courier New", Courier, monospace; font-size: xx-small;">VOID BSPPowerOff()</span><br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New", Courier, monospace;">
</span><span style="font-family: "Courier New", Courier, monospace;">{</span></span><br />
<span style="color: green;"><span style="color: green; font-family: "Courier New", Courier, monospace; font-size: xx-small;"> // If OEMInit() cleared g_pOemGlobal->pfnWriteDebugString to remove VID/PID</span></span><br />
<span style="color: green;"><span style="color: green; font-family: "Courier New", Courier, monospace; font-size: xx-small;"> // from debug output, g_pNKGlobal->pfnWriteDebugString will now be NULL (see</span></span><br />
<span style="color: green;"><span style="color: green; font-family: "Courier New", Courier, monospace; font-size: xx-small;"> // NKPowerOffSystem() in WINCE700\private\winceos\COREOS\nk\kernel\kwin32.c)</span></span><br />
<span style="font-family: "Courier New", Courier, monospace;"><span style="font-size: xx-small;"><span style="color: blue;"><span style="color: blue;"> if</span></span> (NULL == g_pNKGlobal->pfnWriteDebugString)</span></span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: xx-small;"> {</span><br />
<span style="color: green;"><span style="color: green; font-family: "Courier New", Courier, monospace; font-size: xx-small;"> // Set kernel pfnWriteDebugString so that debug prints in OEMPowerOff()</span></span><br />
<span style="color: green;"><span style="color: green; font-family: "Courier New", Courier, monospace; font-size: xx-small;"> // do not crash the system.</span></span><br />
<span style="color: green;"><span style="color: green; font-family: "Courier New", Courier, monospace; font-size: xx-small;"> // NKPowerOffSystem() will restore the orginal value following return </span></span><br />
<span style="color: green;"><span style="color: green; font-family: "Courier New", Courier, monospace; font-size: xx-small;"> // from OEMPowerOff()</span></span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: xx-small;"> g_pNKGlobal->pfnWriteDebugString = (PFN_WriteDebugString)OEMWriteDebugString;</span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: xx-small;"> }</span><br />
<span style="font-family: "Courier New", Courier, monospace; font-size: xx-small;">}</span></span>MartinThttp://www.blogger.com/profile/11857650368898665976noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-20802870127084525662012-06-14T13:10:00.002+00:002012-06-14T13:10:38.393+00:00Choosing the right ARM based System on Module (SOM)I am regularly in the situation where the choice of processor, module and thus vendor selection is still a customer question. This should not be a great surprise as there are so many variants for consideration.
So I’ll try and help with my thought process and highlight the major considerations when making this selection. <a href="http://www.directinsight.co.uk/blogs/techblog/2012/06/choosing-the-right-arm-based-system-on-module-som/">Read more...</a>
Let me know your thoughtsNigelGhttp://www.blogger.com/profile/12983642239807111106noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-18429265010766518852012-04-20T09:30:00.000+00:002012-04-20T09:42:17.551+00:00Removing Process & Thread IDs from WEC 7.0 Serial Debug Output<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">One nice feature in Windows Embedded Compact 7.0 is that, u</span><span style="font-family: Calibri;">nlike earlier versions of Windows CE, the kernel prepends <u>serial </u>debug output with the process and thread identifiers:</span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;"><span style="font-family: Times New Roman;">
</span><span style="font-family: "Courier New"; mso-no-proof: yes;"></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;"><span style="font-family: "Courier New"; mso-no-proof: yes;"><span style="font-size: x-small;">PID:00400002 TID:00C4000A Device Power State =
NdisDeviceStateD3.<o:p></o:p></span></span></span></div>
<span style="font-family: Calibri;"></span><br />
<span style="font-family: Calibri;"><div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
</div>
</span><br />
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Times New Roman;">
</span><span style="font-family: Calibri;">In many cases this is useful and the output is now more like KITL debug output than before. </span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">With KITL debug output the Platform Builder Debug Message Options dialog gives you control of which information is prepended to the debug messages:</span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_h8YdK8dGg9yToDpdlptc68JTYmT1eEGJwGvLXkLJfCbuDjZR6Qs3_PTztrOjJQPDTJctE5a0S3gkhWwkzBcTuQNDuHUGERDV8YRll3iWHjiXRW8mxOoB2wJemrs7cTwVGl21sx3KCOVw/s1600/DebugMessageOptions.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_h8YdK8dGg9yToDpdlptc68JTYmT1eEGJwGvLXkLJfCbuDjZR6Qs3_PTztrOjJQPDTJctE5a0S3gkhWwkzBcTuQNDuHUGERDV8YRll3iWHjiXRW8mxOoB2wJemrs7cTwVGl21sx3KCOVw/s400/DebugMessageOptions.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">So, what happens if you want to remove the PID and TID from the <u>serial</u> debug trace to reduce the volume of information and/or increase speed? There's no Platform Builder option to help.</span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">The answer is to modify the OAL and set </span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: "Courier New", Courier, monospace; font-size: x-small;">g_pOemGlobal->pfnWriteDebugString = NULL;</span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">Setting this pointer to NULL makes the kernel call g_pNKGlobal->pfnWriteDebugString directly instead of prepending the PID/TID information and calling OEMWriteDebugString().</span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">You should be aware that this also bypasses thread synchronization but if you are happy to remove the PID/TID you are probably experienced enough to cope!</span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">For more information refer to </span><span style="font-family: Calibri;">NKOutputDebugString and DoODS in </span><span style="font-family: Calibri;">WINCE700\PRIVATE\winceos\COREOS\nk\kernel\printf.c<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<br /></div>MartinThttp://www.blogger.com/profile/11857650368898665976noreply@blogger.com1tag:blogger.com,1999:blog-213091325940153577.post-74862625898686215542012-04-20T08:43:00.001+00:002012-04-20T09:40:22.783+00:00Res2Res Errors During CE 6.0 Makeimg<span style="font-family: Calibri;">Once again we are hitting problems during makeimg with<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: "Courier New", Courier, monospace;">ERROR: Res2Res: WriteResFile: xxxxxxxxxxxxx<o:p></o:p></span></div>
<span style="font-family: "Courier New", Courier, monospace;">
</span><br />
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">The problem can be “fixed” by either<o:p></o:p></span></div>
<br />
<div class="MsoListParagraph" style="margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; text-indent: -18pt;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Disabling
virus scanning of the temporary directory</span></div>
<br />
<div class="MsoListParagraph" style="margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; text-indent: -18pt;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span style="font-family: Calibri;">Emptying
the temporary directory<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">My temp dir was full of rubbish so I used option 2. The
command line below is much quicker than using Explorer<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt;">
<span style="font-family: "Courier New"; font-size: 10pt;">del /q /f /s %temp%\*<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">This worked for me. However, if the problem persists then try option 1. It worked for a colleague.</span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt;">
<span style="font-family: Calibri;">Hope this helps!<o:p></o:p></span></div>MartinThttp://www.blogger.com/profile/11857650368898665976noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-5692484614800257332012-03-28T10:04:00.003+00:002012-03-28T10:21:30.838+00:00Debugging CE7 apps using VS2005<p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span >If you want to build apps for a CE7 system using visual studio 2005 you can (normally you’d use 2008) if you have an SDK for the Windows Embedded Compact 7 (WinCE7) platform and you follow these steps!</span></p><p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span >I was getting the following error on linking:</span></p><p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "></p><h1 style="border-style: initial; border-color: initial; border-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; color: rgb(58, 62, 67); line-height: 31px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; background-color: rgb(255, 255, 255); "><span name="subject" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-weight: inherit; font-style: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " >corelibc.lib(armsecgs.obj) : fatal error LNK1103: debugging information corrupt; recompile module</span></h1><div><span name="subject" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-weight: inherit; font-style: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " ><br /></span></div><div><span >To work around this:</span></div><p></p><p class="MsoNormal"><span ><span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span class="Apple-tab-span" style="white-space:pre"> </span>-</span><span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "> </span><span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; ">Install the hot fix for VS2005 from </span><a href="http://support.microsoft.com/kb/949009">http://support.microsoft.com/kb/949009</a></span></p><p class="MsoNormal" style="text-indent: 0px;"><span ><span style="text-indent: -18pt; "><span class="Apple-tab-span" style="white-space:pre"> </span>-</span><span style="text-indent: -18pt; "> </span><span style="text-indent: -18pt; ">Fix any build issues in the project arising from defines not available in VS2005, i.e.:</span></span></p> <p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span ><o:p> <span class="Apple-tab-span" style="white-space:pre"> </span></o:p>From imm.h for instance:</span></p> <p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span ><o:p> <span class="Apple-tab-span" style="white-space:pre"> </span></o:p>DWORD WINAPI ImmGetGuideLineW(HIMC, DWORD dwIndex, _Out_bytecap_(dwBufLen) LPWSTR, DWORD dwBufLen);</span></p> <p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span ><o:p> <span class="Apple-tab-span" style="white-space:pre"> </span></o:p>To</span></p> <p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span ><o:p> <span class="Apple-tab-span" style="white-space:pre"> </span></o:p>DWORD WINAPI ImmGetGuideLineW(HIMC, DWORD dwIndex, LPWSTR, DWORD dwBufLen);</span></p> <p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span ><o:p> <span class="Apple-tab-span" style="white-space:pre"> </span></o:p>Basically removing all “<b>_Out_bytecap_(dwBufLen)</b>” from anything that doesn’t build…</span></p> <p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span ><o:p> <span class="Apple-tab-span" style="white-space: pre; "> </span>- </o:p><span style="text-indent: -18pt; ">In the top of one of my files I needed to set</span></span></p> <p class="MsoListParagraph" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-left: 54pt; "><span >#define __INLINEISEQUALGUID__</span></p> <p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span ><o:p> <span class="Apple-tab-span" style="white-space:pre"> </span></o:p>As there seem to be two defines for the same named GUID equality function and it causes a link issue.</span></p> <p class="MsoNormal" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><span ><o:p> </o:p>As the meerkat would say…Simples!</span></p>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-46117972508923967292011-05-10T15:27:00.013+00:002011-05-10T16:32:37.088+00:00Windwos Embedded Compact 7Direct Insight was recently involved in running a Windows Embedded Compact 7 event at the UK Microsoft Campus. From which an article has been written including information and quotes from me and colleagues.<br /><br />You can find the article here at <a href="http://www.mtemag.com/ArticleItem.aspx?Cont_Title=Real-Time+Operating+Systems%3a+Take+seven">http://www.mtemag.com/ArticleItem.aspx?Cont_Title=Real-Time+Operating+Systems%3a+Take+seven</a><br /><br />Please have a read and let me know what you think.<br /><br />>> NigelNigelGhttp://www.blogger.com/profile/12983642239807111106noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-53369676527735129892011-02-11T09:57:00.001+00:002011-02-11T10:00:57.224+00:00Visual Studio 2005 deploy error after downloading a managed code application to a Windows CE6 R3 deviceThanks to William White for this:-<br /><br />After deploying a managed code application to a windows CE6 R3 device you get a deployment error something like:<br /><br />Deploying ‘C:\will\VBProjects\CEApp\bin\Debug\HelloWorld.exe’<br />Deploying ‘C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\windowsce\diagnostics\System_SR_enu.cab’<br />Post-deploy error 0×00000001 returned after calling ‘\Windows\wceload.exe /noui \Windows\System_SR_enu.cab’.<br />========== Build: 1<br /><br />Visual Studio 2005 will attempt to download the .NET CF 2.0 cab file (System_SR_enu.cab) and automatically install if the device does not already contain the run time (however the OS dependencies for the .NET CF 2.0 must be included in the WinCE6 image). It appears that the version of .NET CF 2.0 included with Visual Studio 2005 SP1 is not compatible with the R3 release of Windows CE6. To fix the problem, shutdown all instances of Visual Studio 2005 and simply download and install .NET CF2.0 SP2:<br /><br />http://www.microsoft.com/downloads/en/details.aspx?familyid=AEA55F2F-07B5-4A8C-8A44-B4E1B196D5C0&displaylang=en<br /><br />Try again and everything should be fine.<br /><br />A successful deployment should then look something like:<br /><br />DeviceApplication1 -> C:\Documents and Settings\XPMUser\My Documents\Visual Studio 2005\Projects\DeviceApplication1\DeviceApplication1\bin\Debug\DeviceApplication1.exe<br />—— Deploy started: Project: DeviceApplication1, Configuration: Debug Any CPU ——<br />Deploying ‘C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\windowsce\wce500\armv4i\NETCFV2.wce5.armv4i.cab’<br />Deploying ‘C:\Documents and Settings\XPMUser\My Documents\Visual Studio 2005\Projects\DeviceApplication1\DeviceApplication1\bin\Debug\DeviceApplication1.exe’<br />Deploying ‘C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\windowsce\diagnostics\System_SR_enu.cab’<br />========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========<br />========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========NigelGhttp://www.blogger.com/profile/12983642239807111106noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-91311044932119294822011-01-10T08:18:00.002+00:002011-01-10T08:29:56.671+00:00Keeping your Smartphone alive for background processing<span class="Apple-style-span" >Want to keep your windows mobile smart phone alive, even if the user is trying to force it off? </span><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" >This can be achieved by using the unattended mode, the power manager on Windows Mobile has an unattended state that will effectively look like the phone is off but the CPU will be running in the background with the LCD off. This is used for playing music, downloading emails etc. To invoice this</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" ><span class="Apple-tab-span" style="white-space:pre"> </span>PowerPolicyNotify(PPN_UNATTENDEDMODE, 1);</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" >To release this do</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" ><span class="Apple-tab-span" style="white-space: pre; "> </span>PowerPolicyNotify(PPN_UNATTENDEDMODE, 0);</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" >Whist in this state you may need to poke the device to stay on by calling the above function again. If you want to wake up the device then use another power API:</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" ><div> // Force backlight and power on</div><div> SetSystemPowerState(NULL, POWER_STATE_ON, POWER_FORCE);</div><div><br /></div><div>This will force the system to wake up fully if you want to display information to the user after your background processing.</div></span></div><div><span class="Apple-style-span" > </span></div>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-11226030572098248062010-12-01T20:38:00.002+00:002010-12-01T21:05:38.693+00:00Why's my Alpha blend not working!!<span class="Apple-style-span" style="font-size: medium;"><p>That was what I was saying as I do an AlphaBlend() of a 32 bit bitmap nicely saved in Photoshop, the result was a bitmap with white as the 'background' instead of a nice transparent edge.</p><p>I've seen this before and moving between Desktop and WinCE I seem to have slightly different results with Alpha blending and image factory stuff. Anyhow I found a few people mentioning that you need to pre-multiply any alpha per pixel before using the Alpha blend (which has an alpha on the image as well). Sceptical but tried it and hey presto my bitmaps now render perfectly.</p><p>Here is what I do in Win32:</p></span><pre name="code" class="Cpp">HBITMAP hbmp = CreateDIBSection(hdcScreen, lpbi, DIB_RGB_COLORS, &pvImageBits, NULL, 0);<br /><br />const UINT cbImage = cbStride * height;<br />if (FAILED(ipBitmap->CopyPixels(NULL, cbStride, cbImage, static_cast<BYTE *>(pvImageBits))))<br />{<br />// couldn't extract image; delete HBITMAP<br />DeleteObject(hbmp);<br />hbmp = NULL;<br />}<br /><br />// Pre multiply RGB on alpha channels else alpha blit won't work!<br />//<br />if (lpbi->bmiHeader.biBitCount == 32)<br />{<br /> BYTE* linePtr = (BYTE*)pvImageBits;<br /> for(int y=0;y<height;y++)<br /> {<br /> BYTE* ptr = linePtr;<br /><br /> for(int x=0;x<width;x++)<br /> {<br /> BYTE alpha = *(ptr+3);<br /> *(ptr+0)=(*(ptr+0) * alpha) / 255;<br /> *(ptr+1)=(*(ptr+1) * alpha) / 255;<br /> *(ptr+2)=(*(ptr+2) * alpha) / 255;<br /> ptr+=4;<br /> }<br /><br /> linePtr += cbStride;<br /> }<br />}</pre>Then just AlphaBlend on my bitmap...perfect, but why doesn't AlphaBlend handle the 32 bit bitmaps anyhow that's what I don't understand.... !GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-1893087982210559942010-11-15T09:06:00.000+00:002010-11-15T09:07:03.584+00:00Adding custom notifications to the WM6.5 lock screen<div><span class="Apple-style-span" >If you are wondering how your application can add information on the new WM6.5 lock screen, this can be done easily by utilising a few registry entries! There are two OEM lockscreen entries reserved for OEM applications that will allow applications to register an icon to show on the lock screen with an optional number of unread or unhandled events, when the user slides this to the right or left the application is invoked to deal with the unread events.</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" >The regsitry entry all of this appears under is:</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" ><span class="Apple-tab-span" style="white-space:pre"> </span>HKLM\Software\\Microsoft\\Shell\\LockScreen\\Notifications\\Notif0</span></div><div><span class="Apple-style-span" ><span class="Apple-tab-span" style="white-space:pre"> </span>HKLM\Software\\Microsoft\\Shell\\LockScreen\\Notifications\\Notif1</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" >Add the settings like this:</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" > "Command Line"="\program files\myapp\myapp.exe"</span></div><div><span class="Apple-style-span" > "Image"="\icon_notclicked.png"</span></div><div><span class="Apple-style-span" > "FocusImage"="\icon_clicked.png"</span></div><div><span class="Apple-style-span" > "Notification Count"=dword:0</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" >The command line should point to your application, this will be executed when the user slides your cusom slider to the right. The Image and Focus image are two icons which are shown on the lock screen with and without you pressing them. The notification count should be more than 0 to show your icon and 0 to hide your item. The number in the noticication count is displayed on the lock screen so this could be the number of unread messages or emails you've received, whatever you are counting in your application.</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" >You should check that Notif0 and 1 aren't already used by another application and use the appropriate one.</span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" >Happy screen locking! </span></div><div><span class="Apple-style-span" ><br /></span></div>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-8770161808600914192010-10-27T07:32:00.002+00:002010-10-27T08:01:18.841+00:00Accessing the phone vibrator<span class="Apple-style-span">How can I access the vibrate function from my apps you may say...?</span><div><span class="Apple-style-span"><br /></span></div><div><span class="Apple-style-span">Well the vibrate function is part of the NLED (or notification LED) driver. You can use the NLED functions to pulse or turn on/off the motor in the same way as any LED. To find the vibrator search through the list of LEDs until you find one with a cycle time of -1, this indicates the vibrator.</span></div><div><span class="Apple-style-span"><br /></span></div><div><span class="Apple-style-span">The following code is complete example of searching through the available LEDs and turning on and off only the vibrate function. This should work on any Windows Mobile or Windows CE with a compatible NLED driver:</span><div><span class="Apple-style-span"><br /></span><br /><span class="Apple-style-span" >#include "nled.h"<br /><br />enum Status<br />{<br /> OFF = 0,<br /> ON,<br /> BLINK<br />};<br /><br />int GetLedCount()<br />{<br /> int count = 0;<br /> NLED_COUNT_INFO nci;<br /> if (NLedGetDeviceInfo(NLED_COUNT_INFO_ID, &nci))<br /> </span><span class="Apple-style-span" style="font-family: 'courier new'; ">{</span></div><div><span class="Apple-style-span" > </span><span class="Apple-style-span" style="font-family: 'courier new'; "> </span><span class="Apple-style-span" style="font-family: 'courier new'; ">count = nci.cLeds;</span></div><div><span class="Apple-style-span" > }<br /> return count;<br />}<br /><br />int ledCount = GetLedCount();<br /><br />void SetLedStatus(Status status)<br />{<br /> NLED_SETTINGS_INFO nsi;<br /> NLED_SUPPORTS_INFO nInfo;<br /> nsi.OffOnBlink = (uint)status;<br /> for (int i = 0; i < ledCount; i++)<br /> {<br /> // request information from this led, we're looking for a </span></div><div><span class="Apple-style-span" > // </span><span class="Apple-style-span" style="font-family: 'courier new'; ">cycleAdjust of </span><span class="Apple-style-span" style="font-family: 'courier new'; ">-1 which indicates the vibrator</span></div><div><span class="Apple-style-span" > nInfo.LedNum = i;</span></div><div><span class="Apple-style-span" > NLedGetDeviceInfo(NLED_SUPPORTS_INFO_ID, &nInfo);</span></div><div><span class="Apple-style-span" > if (nInfo.lCycleAdjust == -1)<br /> {</span></div><div><span class="Apple-style-span" > nsi.LedNum = (uint)i;</span></div><div><span class="Apple-style-span" > NLedSetDevice(NLED_SETTINGS_INFO_ID, &nsi);</span></div><div><span class="Apple-style-span" > }</span></div><div><span class="Apple-style-span" > }<br />}<br /><br />void VibrateOn()<br />{<br /> SetLedStatus(Status::ON);<br />}<br /><br />void VibrateOff()<br />{<br /> SetLedStatus(Status::OFF);<br />}<br /><br /><br />int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,<br /> LPTSTR lpCmdLine, int nCmdShow)</span></div><div><span class="Apple-style-span" >{<br /> VibrateOn();<br /> Sleep(500);<br /> VibrateOff();<br />}</span></div></div>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-31010232084393075732010-10-12T10:03:00.002+00:002010-10-12T10:06:36.538+00:00Missing Ordinals in Windows CE<span style="font-family:arial;">If you get the message:<br /><br />ERROR: function @ Ordinal 297 missing<br />Please Check your SYSGEN variable!!!</span><br /><span style="font-family:Arial;"></span><br /><span style="font-family:Arial;">Then the problem is most likely to be a missing funciton in CoreDLL, to check which it is go to the private sources:</span><br /><span style="font-family:Arial;"></span><br /><span style="font-family:arial;">\WINCE600\PRIVATE\WINCEOS\COREOS\CORE\DLL>notepad core_common.def</span><br /><span style="font-family:Arial;"></span><br /><span style="font-family:Arial;">In this you should be able to search for the ordinal number </span><br /><span style="font-family:Arial;"></span><br /><span style="font-family:arial;">; @CESYSGEN IF COREDLL_BATTERY<br />BatteryDrvrGetLevels=BatteryDrvrGetLevels @297<br />BatteryDrvrSupportsChangeNotification=BatteryDrvrSupportsChangeNotification @298<br />BatteryGetLifeTimeInfo=BatteryGetLifeTimeInfo @713<br />BatteryNotifyOfTimeChange=BatteryNotifyOfTimeChange @714<br />GetSystemPowerStatusEx=GetSystemPowerStatusEx @715<br />GetSystemPowerStatusEx2=GetSystemPowerStatusEx2 @1358<br />; @CESYSGEN ENDIF</span><br /><span style="font-family:Arial;"></span>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com1tag:blogger.com,1999:blog-213091325940153577.post-18778676425226686492010-09-29T17:35:00.001+00:002010-09-29T17:36:45.198+00:00Using events and waking devices using CeRunAppAtTime<span class="Apple-style-span" >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:<br /></span><span class="Apple-style-span" ><br /> SYSTEMTIME time;<br /> CTime nextWakeUpTime;<br /><br /> // get local system time and convert time to CTime for now<br /> GetLocalTime(&time);<br /> CTime now(time);<br /><br /> // 30 minutes in the future<br /> nextWakeUpTime=now;<br /> nextWakeUpTime+=CTimeSpan(0,0,30,0);<br /><br /> // convert to systemtime<br /> nextWakeUpTime.GetAsSystemTime(time);<br /><br /> // set for wake up !<br /> CeRunAppAtTime(TEXT("\\\\.\\Notifications\\NamedEvents\\SCHEDULE_WAKEEVENT_EVENT"), &time);<br /><br /> HANDLE wakeEvent = CreateEvent(NULL, FALSE, FALSE, SCHEDULE_WAKEEVENT_EVENT);<br /><br /> // wait for wake up!<br /> if (WaitForSingleObject(wakeEvent, FALSE, INFINITE) == WAIT_OBJECT_0)<br /> {<br /> // sheduled wake up<br /> }</span>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-74277706401447447202010-09-10T11:33:00.003+00:002010-09-10T11:51:45.783+00:00KITL Messages Don't Support Wide StringsI'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.<br /><br />On several platforms I've seen the KITL device name is not printed correctly. The device name is the <em>name</em> member of the OAL_KITL_DEVICE structure and is defined as a LPCWSTR.<br /><br />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.<br /><br />Reviewing the private sources confirms the problem. Only the %s format is supported and this is for character strings only.<br /><br />Also be aware that formatting such as %08x is not supported either, but %X is fine!MartinThttp://www.blogger.com/profile/11857650368898665976noreply@blogger.com2tag:blogger.com,1999:blog-213091325940153577.post-34357787145867972132010-09-06T18:35:00.001+00:002010-09-06T18:35:39.204+00:00Using #include from BIB files<div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">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 </span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">platform.reg</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">#include "$(_TARGETPLATROOT)\SRC\DRIVERS\display\display.reg"</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">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!</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">platform.bib</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">#include "$(_TARGETPLATROOT)\SRC\DRIVERS\display\display.bib"</span></div><div><br /></div>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-8646535508408021892010-08-18T17:41:00.004+00:002010-08-18T19:43:09.902+00:00Page faults on resume from suspend with COMPRESSION=on<div><span class="Apple-style-span" style="font-family:arial;"><pre><span class="Apple-style-span" style="font-family:arial;font-size:130%;"><span class="Apple-style-span" style="font-size: 16px; white-space: normal;">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:</span></span></pre><pre><span class="Apple-style-span" style="font-family:arial;font-size:130%;"><span class="Apple-style-span" style="font-size: 16px; white-space: normal;">COMPRESSION=ON</span></span></pre><pre><span class="Apple-style-span" style="font-family:arial;font-size:130%;"><span class="Apple-style-span" style="font-size: 16px; white-space: normal;">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.</span></span></pre><pre><span class="Apple-style-span" style="font-family:arial;font-size:130%;"><span class="Apple-style-span" style="font-size: 16px; white-space: normal;">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. </span></span></pre></span></div>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-10104824781929549822010-07-08T20:33:00.002+00:002010-07-08T20:38:20.876+00:00Transformations in WindowsCE using SetMapMode<span class="Apple-style-span" style="font-family:arial;">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?</span>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-50004120632789180072010-06-09T07:13:00.003+00:002010-06-09T07:17:40.226+00:00Windows CE 7.0 PreviewMicrosoft have unveiled a technology preview of Windows Embedded Compact Edition (windows CE) version 7.0, the preview can be downloaded from <a href="http://www.microsoft.com/windowsembedded/en-us/products/windowsce/compact7.mspx">http://www.microsoft.com/windowsembedded/en-us/products/windowsce/compact7.mspx</a> go check it out now!GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-39470415702579295292010-05-24T11:42:00.005+00:002010-05-24T11:57:54.724+00:00Summer 2010 EmbeddedSPARK CompetitionTo all you embedded hobbyists. I Just want to highlight the latest Microsoft embeddedSPARK compitition on this summer. Given the latest release, this round of the competition is focused on Embedded Standard 7.<br /><br />You can find all the information you need to enter at <a href="http://www.embeddedspark.com/">http://www.embeddedspark.com/</a><br /><br />A video about this can also be seen at <a href="http://www.embeddedspark.com/public/videos/embeddedSPARKSUMMER_howto.wmv">http://www.embeddedspark.com/public/videos/embeddedSPARKSUMMER_howto.wmv</a> <br /><br />FYI - Round 1 closes on June 8<br />Any questions or issues I can help with please let me know.<br /><br />>> NigelNigelGhttp://www.blogger.com/profile/12983642239807111106noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-50871504889912089472010-05-20T18:40:00.002+00:002010-05-20T18:45:03.830+00:00Setting up COM buffers<span class="Apple-style-span" style="font-family:arial;">I was pointed to this today to set the size of serial buffers on WinCE:</span><div><pre><span class="Apple-tab-span" style="white-space:pre"> </span>BOOL SetupComm( <span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-tab-span" style="white-space:pre"> </span>HANDLE <i>hFile</i>, <span class="Apple-tab-span" style="white-space:pre"> </span>DWORD <i>dwInQueue</i>, <span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-tab-span" style="white-space:pre"> </span>DWORD <i>dwOutQueue</i> <span class="Apple-tab-span" style="white-space:pre"> </span>);</pre><pre><span class="Apple-style-span" style="font-family: Georgia, serif; white-space: normal; font-size: 16px; "><span class="Apple-style-span" style="font-family:arial;">This should control the internal buffer sizes for the COM port... but the amusing comment in MSDN says:</span><div></div></span></pre><pre><span class="Apple-style-span" style="font-family:arial;font-size:130%;"><span class="Apple-style-span" style="font-size: 16px; white-space: normal;"><span class="Apple-tab-span" style="white-space:pre"> </span>Always returns FALSE because the FIFO queue size cannot be changed</span></span></pre><div><span class="Apple-style-span" style="font-family:arial;">Err... so does this work!?</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div></div>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-48913132947721586002010-05-12T07:27:00.003+00:002010-05-12T07:50:56.378+00:00Realtime CPU calculation for CE debugging<span class="Apple-style-span" style="font-family:arial;">Quite often I've been in the situation where a process or thread has gone rogue and I've been trying to track down why the system has ground to a halt. </span><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">One of the things I find most helpful is the SnapShot tools, this allows you to take a snapshot of the system for its current running processes or threads, this can be useful in itself but using the GetThreadTimes API you can then print out any high CPU users, basically creating your own mini-task manager for Windows CE.</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">Firstly take a snapshot of the system:</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">HANDLE hSnapshot = CreateToolhelp32Snapshot (TH32CS_SNAPTHREAD, 0);</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">Secondly call Thread32First/Next on the snapshot to retrieve all the thread information:</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> <span class="Apple-style-span" style="font-family: Georgia, serif; white-space: normal; "><span class="Apple-style-span" style="font-family:arial;">THREADENTRY32 te[256];</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">// up to 256 threads</span></span></span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">int used = 0;</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> <span class="Apple-style-span" style="white-space: normal; ">te[used].dwSize = sizeof(THREADENTRY32);</span></span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">if ( Thread32First(hSnapshot,&te[used]) ) </span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">{</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">do</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">{</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">..</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">..</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">used++;</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">te[used].dwSize = sizeof(THREADENTRY32);</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">}</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span><span class="Apple-style-span" style="font-family:arial;">while (Thread32Next(hSnapshot,&te[used]));</span></div><div><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-family: Georgia, serif; "><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-family:arial;"> </span></span>}</span> </span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">Finally iterate through the threads getting their thread times, creating times etc:</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;"><div><span class="Apple-tab-span" style="white-space:pre"> </span>FILETIME creationTime,exitTime;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>FILETIME ktTime[256];</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>FILETIME utTime[256];</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>GetThreadTimes ((HANDLE)te[used].th32ThreadID, </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>&creationTime, </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>&exitTime, </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>&ktTime[used], </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>&utTime[used]);</div><div><br /></div><div>This can be done in the while loop above, you can also use the results from the snapshot over and over with a sleep(1000), compare the results and print out the top XX threads using CPU to give some realtime feedback on the system usage.</div><div><br /></div><div>Commonly my applications and kernel development use this method to ensure that the system is using the expected CPU time when being developed.</div><div><br /></div></span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-54763490174875987952010-05-06T16:57:00.005+00:002010-05-06T17:21:25.783+00:002010 Embedded Market Study shows Microsoft embedded OS's are on the way up...<span class="Apple-style-span" style="font-family:arial;">The 2010 Embedded Market Study from EE Times group is out now, they reviewed 1,574 surveys on embedded designs. </span><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">This year we should be expecting the Wind River (VxWorks) to take the top 17% of upcoming embedded designs, followed by 13% for Debian (Linux), then Windows CE closely following at 13% and then Windows (XP Embedded) at 12%. </span><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">Windows CE and Windows XP Embedded are up 1% on last years survey, and between them take a whopping 25% of new designs, great news!</span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;">Check out the Webinar on <span class="Apple-style-span" style="font-family: Georgia, serif; "><a href="http://www.techonline.com/learning/livewebinar/224000228"><span class="Apple-style-span" style="font-family:arial;">http://www.techonline.com/learning/livewebinar/224000228</span></a><span class="Apple-style-span" style="font-family: arial; "> for on-demand playback.</span></span></span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div><div><span class="Apple-style-span" style="font-family:arial;"><br /></span></div></div>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-29910740425910635552010-05-06T16:47:00.002+00:002010-05-06T16:56:44.304+00:00Snooze using SleepTilTick<span class="Apple-style-span" style="font-family:arial;">A not so well known function, this little API allows a thread to relinquish its hold on the system until the next tick normally 1ms great for polling loops when used in conjunction with high priority threads... </span>GraemeWhttp://www.blogger.com/profile/06099386774748956811noreply@blogger.com0tag:blogger.com,1999:blog-213091325940153577.post-37113880217784767072010-04-30T15:54:00.003+00:002010-04-30T16:22:38.131+00:00Windows Embedded 7 RTMAfter months of a CTP version being available the final version has been released to manufacturer. Windows Embedded Standard 7, the successor of Windows XP Embedded was released April 27th 2010 at the ESC West - Silicon Valley<br /><br />Windows Embedded Standard 7 is the first embedded OS based on the successful desktop o/s Windows 7. Thus the aligned naming.<br /><br />It is a highly customizable embedded o/s in a componentized form, which allows OEMs to build devices with a control over the memory footprint and the addition of embedded enabling features (HORM etc.) but still get the familiarity and power of Windows 7.<br /><br />You can find the Windows Embedded Standard 7 RTM press release <a href="http://www.microsoft.com/windowsembedded/en-us/about/pressroom/pressreleases/wes7_release.mspx">here</a>.<br /><br />But if you want to learn more and you’re in the UK why not come to the Microsoft HUB event next Thursday 6th May.<br />I’ll be there on the Direct Insight booth and in our Windows Embedded CE- Hands on Lab event. <a href="http://www.hub-event.com/UK.php">So why not register via this link</a><br /><br />>> NigelNigelGhttp://www.blogger.com/profile/12983642239807111106noreply@blogger.com0