<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Of Kings and Cabbage</title>
  <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/" />
  <link rel="self" href="http://blog.opennetcf.com/afeinman/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2008-02-28T08:03:10.7633371-06:00</updated>
  <author>
    <name>Alex Feinman</name>
  </author>
  <subtitle>Compact Framework Musings. Alex Feinman's web log</subtitle>
  <id>http://blog.opennetcf.com/afeinman/</id>
  <generator uri="http://www.dasblog.net" version="1.8.5223.2">DasBlog</generator>
  <entry>
    <title>Russian science in trouble</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,bec1694f-766b-4d85-9bf3-02e63582c4b3.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,bec1694f-766b-4d85-9bf3-02e63582c4b3.aspx</id>
    <published>2008-02-28T05:22:35.7100000-06:00</published>
    <updated>2008-02-28T08:03:10.7633371-06:00</updated>
    <category term="Life" label="Life" scheme="dasBlog" />
    <category term="Rant" label="Rant" scheme="dasBlog" />
    <category term="Science" label="Science" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      It is sometimes said that the reason Soviet Union has produced so many outstanding
      scientists is that a lot of attention was being paid to introducing kids to science
      early and in a way that kept them interested. Indeed, a large amount of popular science
      books has been printed over the years as well as translations made of the best ones
      offered in the rest of the world. Martin Gardner and Richard Feinman, absolutely fascinating
      Robert Wood biography, Smullyan, Soviet authors Perelman and Makovetsky - all of those
      made me fall in love with physics, mathematics, mechanics, chemistry as a kid. And
      of course these books were fairly accurate as they were either authored or reviewed
      by respected professionals.
   </p>
        <p>
      Times change and these days people find that you cannot blindly trust books you buy.
      Quite recently a <a href="http://community.livejournal.com/astronomy_ru/96772.html">very
      lively discussion </a>took place in one of the LiveJournal communities (very popular
      in Russia). It was about a book recently printed in Moscow called "Unabridged
      Encyclopedia of Astronomy". The book that contains 25000 articles, has many entries
      that make even a casual student of science do a doubletake (some of it could be explained
      by the fact that the entire author team somehow did not have a single specialist in
      astronomy or even general physics among them). 
   </p>
        <p>
      Here are some gems (translated from original Russian as closely as possible)
   </p>
        <p>
      "<strong>Gravitational waves</strong> - are emitted by electrical charge oscillating
      in space"
   </p>
        <p>
      "<strong>Barnard star</strong> - a <em>stationary</em> star with visual magnitude
      of 9.5m... Known for being <em>fast-moving</em>..."
   </p>
        <p>
      "<strong>Visible radiation</strong> - radiation that is not only visible to the naked
      eye, but to the special astronomical equipment and devices..."
   </p>
        <p>
      "<strong>Visible light</strong> - light being radiated by a heated body..."
   </p>
        <p>
      "<strong>Escape velocity</strong> - [is] defined as speed required for a man-made
      satellite to reach the Earth orbit. Equals 12km/s"
   </p>
        <p>
      "<strong>Galactic Cannibalism</strong> (Extragalactic Astronomy) - a part of Astronomy
      dealing with celestial bodies (stars, galaxies, quasars etc) that exist outside our
      Galaxy"
   </p>
        <p>
      "<strong>Ultraviolet radiation</strong> - radiation emitted by the Sun and stars"
   </p>
        <p>
      "<strong>Interference </strong>- wave oscillation produced by the light source generates
      so called spherical wave fronts"
   </p>
        <p>
      "<strong>Polar Star</strong> - the main star <u>L</u> of Ursa Minor constellation
      and the brightest star of the northern hemisphere"
   </p>
        <p>
      "<strong>Rigel</strong> - the brightest star in the constellation of Orion and in
      the entire sky"
   </p>
        <p>
      "<strong>Lynx</strong> - one of the constellations of the southern hemisphere"
   </p>
        <p>
      "<strong>Triton</strong> - a constellation discovered by Lassell in 1846. It's mass
      is calculated at 2.14x10^22 kg" 
   </p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <em>The next one is tricky. It makes no sense at all in Russian, so be prepared for
      the same in English translation.</em>
          </p>
        </blockquote>
        <p>
      "<strong>Phase angle</strong> - an angle situated at a distance from the Sun to the
      Moon as well as from the Moon to the Earth"
   </p>
        <p>
      "<strong>Fundamental Astronomy</strong> - modern physical-mathematical discipline
      growing interdependent with advances in science and technology"
   </p>
        <p>
      Fortunately, some astute readers (one of them employed by Moscow planetarium - must
      know her astronomy, eh?) were able to spot it and raise some ruckus. As they were
      not able to get any response from the publisher, someone suggested to make a formal
      complaint to the russian authorities, invoking Consumer Protection Act. We'll see
      how it goes.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=bec1694f-766b-4d85-9bf3-02e63582c4b3" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Running RTF Host (Compact Framework 3.5 Power Toys) on emulator</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,5291cae4-c5d8-4333-a5d7-d4a57646e7e5.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,5291cae4-c5d8-4333-a5d7-d4a57646e7e5.aspx</id>
    <published>2008-02-26T08:46:07.8940000-06:00</published>
    <updated>2008-02-26T08:46:36.4568750-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://blogs.ugidotnet.org/raffaele">Raffaele Rialdi </a>pointed out that
      attempting to run RTF Host from Compact Framework 3.5 Power Toys on an emulator produces
      the following error:
   </p>
        <p>
          <img src="http://blog.opennetcf.org/afeinman/content/binary/RTFError.png" border="0" />
        </p>
        <p>
      This is caused by RTF getting confused because the default CoreCon transport on the
      emulator is DMA (DeviceDMA.dll). Here are the steps to add emulator as a manual Tcp
      connection. Not that many will need it, but it is useful for a demo
   </p>
        <p>
      1. Start Emulator using Device Emulator Manager.<br />
      2. Configure Network and Storage card folder<br />
      3. Copy to storage card folder the following file: "C:\Program Files\Common 
      <br />
      Files\microsoft shared\CoreCon\1.0\Target\wce400\armv4i\TCPConnectionA.dll"<br />
      4. In File ExplorerNavigate to \Windows\Corecon1.1. If you don't see it 
      <br />
      there, connect to the emulator from Studio<br />
      5. Launch ClientShutdown (you should see a guid-named folder to appear)<br />
      6. Copy \Storage Card\TcpConnectionA.dll to \Windows<br />
      7. Go to \Windows and delete DeviceDMA.dll (if you can't, you forgot to 
      <br />
      launch ClientShutdown)<br />
      8. Go back to \Windows\Corecon1.1 and launch ConmanClient.exe<br />
      9. Launch RTF Host. Enjoy<br /></p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=5291cae4-c5d8-4333-a5d7-d4a57646e7e5" />
      </div>
    </content>
  </entry>
  <entry>
    <title>PowerDVD Ultra - first experiences</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,ad573686-ebbb-477a-8086-9a9ef7c893a4.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,ad573686-ebbb-477a-8086-9a9ef7c893a4.aspx</id>
    <published>2007-12-29T18:17:35.0995000-06:00</published>
    <updated>2007-12-29T18:17:35.0995000-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Cyberlink was kind enough to let me evaluate the latest version of their PowerDVD
      Ultra product - about a year ago. Yet I procrastinated. Now, a year later I found
      myself in posession of a <a href="http://www.dell.com/content/products/productdetails.aspx/xpsdt_420?c=us&amp;cs=19&amp;l=en&amp;s=dhs&amp;~tab=bundlestab">brand-new
      Media Center machine </a>(does the phrase "Dude, you are getting a Dell" sound familiar?), which
      is connected to a brand new <a href="http://www.samsung.com/us/consumer/detail/detail.do?group=televisions&amp;type=televisions&amp;subtype=lcdtv&amp;model_cd=LNT5271FX/XAA">1080P
      Samsung LCD TV</a>. I've slightly upgraded it with an LG GGC-H20L Blu-Ray/HD-DVD Reader and
      realized, how close I to being finally able to watch HD DVDs on a Media Center machine
      (instead of Xbox 360). This is where I remembered about Cyberlink generous offer. 
   </p>
        <p>
      After a painless 100MB download (you can buy all of the Cyberlink products electronically,
      directly on their web site, and depending on the speed of your connection, you will
      get to install it in 5-10 min), I ran the setup and was shortly rewarded with the
      activation dialog. I am not big fan of software activation (Windows or any other),
      but as far as the activation experiences go, this one was seamless and easy.
   </p>
        <p>
      PowerDVD comes with a companion application called BluRay Advisor (there is also nearly
      identical HD DVD Advisor). This application checks your system for being ready to
      play HD content. The last time I ran it a year ago, I got a message saying that my
      display card was underpowered, my CPU - barely sufficient (P IV 3.6GHz) and my TV
      entirely unsuitable due to the lack of HDCP support. This time I had a green light
      on every item, except the video driver - the Advisor did not recognize the driver
      version and indicated the status as unknown.
   </p>
        <p>
      My TV uses so called 10' setup, meaning that normally there is no keyboard or mouse
      connected to it (well, there is a Media Center keyboard, just in case, but I
      rarely use it). Earlier versions of PowerDVD did not fare well with the Media Center
      remote, but the current one does not seem to have any problems. I was able to control
      it perfectly well, except of going into settings and such. For day-to-day needs, such
      as watching DVD MCE Remote gives you all control you need.
   </p>
        <p>
      PowerDVD fully supports HD DVD menu system. My experience with it did not differ from
      Xbox 360 one.
   </p>
        <p>
      There are few minor annoyances - nothing critical, but I have to mention them:<br />
       - when starting playback, Vista pops a message saying that the application is
      not compatible with Windows Aero and that Windows will switch into basic mode.<br />
       - I was not able to figure out how to select the disk to play. The machine has
      a regular DVD drive, an HD DVD drive and a DVD changer. By default the player picks
      the first of them. I'm sure there is a setting somewhere, but I wish it were
      more accessible. As it is I have to open Computer window and select the disc I want
      to play<br />
      - The status overlay that's shown in the upper right corner when you are controlling
      volume, is way too small. From the couch it is nearly impossible to read.
   </p>
        <p>
      I want to emphasize, that the above list is of really minor issues. The application
      is very good in every way and does the job of playing DVDs and HD DVDs nearly perfectly.
      The picture quality is superb, there are no artifacts or playback delays, missed frames
      and other unpleasant occurences that might mire your viewing experience.
   </p>
        <p>
      In conclusion I wanted to mention the auto update feature. It is not something new
      - Microsoft, Adobe, Intel and quite a few others have it. Nevertheless it is gratifying
      to know that you don't have to check the web site for updates constantly (and who
      doesn't love updates) - it's done for you.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=ad573686-ebbb-477a-8086-9a9ef7c893a4" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DirectDraw experiences (Part III)</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,e6d0cf14-6264-4b77-9c96-d2ebdd09fd6f.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,e6d0cf14-6264-4b77-9c96-d2ebdd09fd6f.aspx</id>
    <published>2007-12-26T03:50:12.4580000-06:00</published>
    <updated>2007-12-26T04:07:39.7866250-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      This one has been actually gleaned through a usenet post, but needs a wider coverage
   </p>
        <h5>Trying to use dwAlphaConst member of DDOVERLAYFX structure to specify
      overall overlay transparency results in E_INVALIDARG error
   </h5>
        <p>
          <font size="2">As explained <a href="http://groups.google.com/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/8263cc28238a4092/1fb494361d758ec7">here</a>,
      there is a clever bug in the parameter checking logic that results in the API soundly
      rejecting any combination of dwAlphaConst and dwAlphaConstBitDepth, unless dwAlphaConst
      == 1 &lt;&lt; dwAlphaConstBitDepth. This is not fixed as of WM 6 AKU4. Interestingly
      enough the actual value of dwAlphaConstBitDepth seems to be ... ignored, once the
      parameter check is done. The bit depth used is always 8 bit.</font>
        </p>
        <ul>
          <li>
            <font size="2">The net result of this bug is that the allowed values for the dwAlphaConstBitDepth/dwAlphaConst
         and the resulting opacity are<br />
         1/2 - 0.78%<br />
         2/4 - 1.6%<br />
         3/8 - 3.1%<br />
         4/16 - 6.2%<br />
         5/32 - 12.5%<br />
         6/64 - 25%<br />
         7/128 - 50%</font>
          </li>
        </ul>
        <p>
      Not using DDOVER_ALPHACONSTOVERRIDE gives you of course 100% (opaque overlay). In
      my experience anything under 5 (12.5%) is too small to be useful, but YMMV. Here
      is the code snippet:
   </p>
        <font size="2">
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (
      fUseAlpha )<br />
      {<br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (
      dwAlpha &gt; 8 ) <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
      Bug in ddraw</span><br />
              dwAlpha <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> 8;<br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (
      dwAlpha &lt; 8 )<br />
          {<br />
              dwUpdateFlags |= DDOVER_ALPHACONSTOVERRIDE;<br />
              ovfx.dwAlphaConst <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> 1
      &lt;&lt; dwAlpha;<br />
              ovfx.dwAlphaConstBitDepth <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> dwAlpha;<br />
          }<br />
      }</span>
          </p>
        </font>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=e6d0cf14-6264-4b77-9c96-d2ebdd09fd6f" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DirectDraw experiences (Part I|)</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,018a8ea8-6d78-45ae-ba96-143caab7c842.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,018a8ea8-6d78-45ae-ba96-143caab7c842.aspx</id>
    <published>2007-12-26T03:25:03.6147500-06:00</published>
    <updated>2007-12-26T03:25:03.6147500-06:00</updated>
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <h5>Call to IDirectDrawSurface::Blt returns E_INVALIDARG
   </h5>
        <p>
      While possible causes for this error are numerous, I wanted to point out a specific
      one that is not mentioned anywhere: either source or destination rectangle is
      empty ( zero width or height )
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=018a8ea8-6d78-45ae-ba96-143caab7c842" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DirectDraw experiences (Part I)</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,d1fb6baf-46d5-4c0d-a069-47615c41da9b.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,d1fb6baf-46d5-4c0d-a069-47615c41da9b.aspx</id>
    <published>2007-12-26T03:20:39.8803750-06:00</published>
    <updated>2007-12-26T03:20:39.8803750-06:00</updated>
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      It's been a while. Things were a bit hectic. Nevertheless I am back.
   </p>
        <p>
      These days I am working on a rather interesting project involving DirectDraw on Windows
      Mobile 6. Without going into the project details, I wanted to share some experiences.
      So far, a number of time I would run into an issue, and of course not it would not
      be explained/documented/covered anywhere where the Google search takes you. It struck
      me that I must be not the first one to hit these issues, and if I list them here,
      chances are that Google search will be more productive for the next poor sod to plow
      through underdocumented (to put it mildly), convoluted (again, to put it mildly) and
      unforgiving API such as DirectDraw. I am going to have multiple posts with keywords
      facilitating search. If a month from now you will find out that I produced all of
      one post (this one seems to be on track so far. Chances for it not making it are slim),
      don't judge me too hard. I am away from home for the 3rd week in a row, having missed
      Christmas, but should be back for the New Year. Ok, here goes.
   </p>
        <p>
          <hr />
        </p>
        <h5>Call to IDirectDrawSurface::Blt returns DDERR_SURFACEBUSY
   </h5>
        <p>
      The documentation says to check for other threads accessing your surface at the same
      time. The group search suggests to search for mismatching Lock/Unlock calls. The actual
      cause turned to be a missed call to IDirectDrawSurface::ReleaseDC (after a successfull
      call to IDirectDrawSurface::GetDC). If you think about it, internally these calls
      must be using Lock/Unlock, so cudos to Group search and boo to MSDN documentation
   </p>
        <p>
       
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=d1fb6baf-46d5-4c0d-a069-47615c41da9b" />
      </div>
    </content>
  </entry>
  <entry>
    <title>WISPLite on Windows Mobile 6</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,e6309045-3f60-4ec4-835f-34a7a98c3ab5.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,e6309045-3f60-4ec4-835f-34a7a98c3ab5.aspx</id>
    <published>2007-06-01T16:20:22.8450000-05:00</published>
    <updated>2007-06-01T16:26:29.8926250-05:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I was quite surprised to learn that apparently I have missed an important new feature
      of Windows Mobile 6 (Professional)- <a href="http://msdn2.microsoft.com/en-us/library/bb431764.aspx">inking
      and ink serialization support</a>. Gone are the days when a developer had to tinker
      with oh-so-temperamental InkX control. Now everyone and his brother can take advantage
      not only of high-quality precision ink support with smoothing and serialization, but
      also of handwriting recognition built into Windows Mobile 6 Professional. To quote
      the documentation - <em>"It provides a rich inking experience, through high quality
      curve–fitted ink with anti-aliasing, transparent ink, and highlighter ink. It provides
      an API for Ink collection, data management, rendering, and recognition. It also provides
      Ink controls to support the note–taking scenario."</em></p>
        <p>
      Another important feature is interoperability and serialized data format compatibility
      with ink support on Tablet PC.
   </p>
        <p>
      While all of this is nice, there is slight bit of bad news - using this rich set of
      goodies requires C++. There are 2 ways to use ink in Windows Mobile 6 - InkCanvas
      control and an COM automation library. <a href="http://msdn2.microsoft.com/en-us/library/bb431715.aspx">InkCanvas
      control </a>offers the ability to use a regular Win32 control (similar to InkX)
      to write, highlight, collect ink etc via <a href="http://msdn2.microsoft.com/en-us/library/bb160710.aspx">a
      set of Windows messages</a>. <a href="http://msdn2.microsoft.com/en-us/library/bb431732.aspx">COM
      automation library </a>on the other hand allows accessing the entire set of features
      offered by WISP. And there is no managed wrapper for the time being.
   </p>
        <p>
      As a public service, we at <a href="http://www.OpenNETCF.com">OpenNETCF.com</a> are
      proud to offer <a href="http://www.opennetcf.com/downloads/download.aspx?s=OpenNETCF.WindowsMobile.Ink">WISPLite
      managed wrapper</a>. The wrapper offers the entire WISPLite functionality (although
      not every method of every interface has been tested). There is InkControl class, which
      wraps InkCanvas, and a OpenNETCF.WindowsMobile.Ink namespace that contains imported
      COM interfaces. Some of the interfaces do not wrap cleanly, so a bit of coding is
      needed.
   </p>
        <p>
      Here is what the demo app looks like (warning, before running it, change line 132
      in Form1.cs to be
   </p>
        <font size="2">
          <p>
      inkControl1.SetPenStyle((
   </p>
        </font>
        <font color="#0000ff" size="2">float</font>
        <font size="2">)trackBar1.Value,
   penColor, penType); )</font>
        <p>
          <img src="http://blog.opennetcf.org/afeinman/content/binary/InkDemo.png" border="0" />
        </p>
        <p>
      Saving ink data to a file:
   </p>
        <font size="2">
          <p>
          </p>
        </font>
        <font color="#0000ff" size="2">using</font>
        <font size="2"> (</font>
        <font color="#2b91af" size="2">SaveFileDialog</font>
        <font size="2"> fd
   = </font>
        <font color="#0000ff" size="2">new</font>
        <font size="2">
        </font>
        <font color="#2b91af" size="2">SaveFileDialog</font>
        <font size="2">())<br />
   {<br />
     fd.Filter = </font>
        <font color="#a31515" size="2">"Ink files (*.isf)|*.isf|All
   files (*.*)|*.*"</font>
        <font size="2">;<br />
     </font>
        <font color="#0000ff" size="2">if</font>
        <font size="2"> (fd.ShowDialog()
   == </font>
        <font color="#2b91af" size="2">DialogResult</font>
        <font size="2">.OK)<br />
     {<br />
       </font>
        <font color="#0000ff" size="2">byte</font>
        <font size="2">[]
   data = (</font>
        <font color="#0000ff" size="2">byte</font>
        <font size="2">[])inkControl1.GetInkData(</font>
        <font color="#2b91af" size="2">IC_INKENCODING</font>
        <font size="2">.BINARY);<br /></font>
        <font color="#2b91af" size="2">
          <font color="#003300">    </font>FileStream</font>
        <font size="2"> stm
   = </font>
        <font color="#2b91af" size="2">File</font>
        <font size="2">.OpenWrite(fd.FileName);<br />
       stm.Write(data, 0, data.Length);<br />
       stm.Close();<br />
     }<br />
   }</font>
        <p>
          <font size="2">Getting ink as bitmap and retrieving recongnition result:</font>
        </p>
        <font size="2">
          <p>
      pbPreview.Image = inkControl1.GetInkDataAsBitmap();<br />
      lblReco.Text = inkControl1.RecognizedText;
   </p>
        </font>
        <p>
          <font size="2">In conclusion I'd like to ask to report problems with this wrapper
      to this blog's comments. 
      </font>
        </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=e6309045-3f60-4ec4-835f-34a7a98c3ab5" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Enabling CoreCon logging in NETCFv2</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,6c113acf-7ec2-4328-a154-16c29a4737ce.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,6c113acf-7ec2-4328-a154-16c29a4737ce.aspx</id>
    <published>2007-04-17T14:12:44.6752500-05:00</published>
    <updated>2007-04-17T14:12:44.6752500-05:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Sometimes when trying to connect Visual Studio t a device, especially to a custom
      CE platform, it is helpful to see if there are any problems reported by the CoreCon
      components on the device side. CoreCon components (ConmanClient, trasnport DLLs, edbgtl.dll
      and edm.exe) all have an integrated logging facility, which can be used by a developer
      for troubleshooting.
   </p>
        <p>
      To enable Corecon debug log you can set the following under HKLM\Software\Microsoft\VSD\Logging
   </p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New">VSD_LogEnabled: DWORD:1,0</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogToDebugger: DWORD:1,0</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogToConsole: DWORD: 1,0</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogToFile: DWORD:1,0</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogLevel: DWORD - set to at least 4, up to 9</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogFile: REG_SZ (default VSDLogFile.txt)</font>
          </p>
        </blockquote>
        <p>
      Keep in mind that the ConMan log can be quite chatty, so enable it sparingly and only
      when needed
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=6c113acf-7ec2-4328-a154-16c29a4737ce" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Using RAPI to provision devices from the desktop</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,bdea60e3-69db-4971-ab3a-ff5e293bcaee.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,bdea60e3-69db-4971-ab3a-ff5e293bcaee.aspx</id>
    <published>2007-04-13T19:43:46.9720000-05:00</published>
    <updated>2007-04-13T19:57:22.0190000-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      XML-based device configuration is a powerful mechanism of configuring Windows
      Mobile 2003 and newer devices. There are four ways to provision your device with new
      settings:
   </p>
        <ol>
          <li>
         Call <a href="http://msdn2.microsoft.com/en-us/library/ms852998.aspx">DMProcessConfigXML </a>on
         device. It can be done from <a href="http://windowsmobilepro.blogspot.com/2006/02/how-to-programmatically-query-mail.html">native</a> or <a href="http://www.smartphonethoughts.com/articles.php?action=expand,4397">managed</a> code. 
      </li>
          <li>
            <a href="http://blogs.msdn.com/windowsmobile/archive/2006/01/28/making_a_root_cert_cab_file.aspx">Build
         a CAB file containing _setup.xml </a>with provisioning XML and run it on the device 
      </li>
          <li>
         Send the xml configuration via WAP push 
      </li>
          <li>
         Use <a href="http://msdn2.microsoft.com/en-us/library/aa454232.aspx">RapiConfig </a>tool
         shipped with WIndows Mobile SDK (under Tools)</li>
        </ol>
        <p>
      But what if you wanted to perform configuration from your own, PC-based installer?
      Granted, you could use method 2 and copy the cab over to the device, then invoke wceload
      etc. Or you could write your own RAPI dll and use CeRapiInvoke. Or perhaps even launch
      RapiConfig to do this for you. Fortunately there is an easier way. As one could suspect,
      RapiConfig does not use a complex approach. Rather it benefits from an undocumented
      but handy RAPI call that is the desktop version of DMProcessConfigXML. It is exported
      by ordinal (25) and has the same signature as DMProcessConfigXML. Unlike DMProcessConfigXML,
      the pointer returned by it in the 3rd parameter needs to be freed using CeRapiFreeBuffer.
   </p>
        <p>
          <font face="Courier New">#pragma comment(lib, "rapi")</font>
        </p>
        <p>
          <font face="Courier New">STDAPI CeRapiInit();<br />
      STDAPI CeRapiUninit();<br />
      STDAPI CeRapiFreeBuffer(LPVOID);<br />
      typedef HRESULT (__stdcall *CeProcessConfigType)(LPCWSTR pszConfig, DWORD dwFlags,
      LPCWSTR* ppszConfigOut);</font>
        </p>
        <p>
          <font face="Courier New">int _tmain(int argc, _TCHAR* argv[])<br />
      {<br />
       if ( argc != 3 )<br />
       {<br />
        _tprintf(_T("Usage: rapiconfig &lt;config file&gt; &lt;out file&gt;\n"));<br />
        return 1;<br />
       }</font>
        </p>
        <p>
          <font face="Courier New"> CeRapiInit();<br />
       <br />
       CeProcessConfigType CeProcessConfig = 
      <br />
         (CeProcessConfigType)GetProcAddress(GetModuleHandle(_T("rapi.dll")),
      (LPCSTR)25);</font>
        </p>
        <p>
          <font face="Courier New"> HANDLE hFile = CreateFile(argv[1], GENERIC_READ, FILE_SHARE_READ,
      NULL, OPEN_EXISTING, 0, NULL);<br />
       if ( hFile == INVALID_HANDLE_VALUE )<br />
       {<br />
        _tprintf(_T("Unable to open %s\n"), argv[1]);<br />
        goto Exit;<br />
       }</font>
        </p>
        <p>
          <font face="Courier New"> DWORD cbConfig = GetFileSize(hFile, NULL);<br />
       BYTE* pBuffer = new BYTE[cbConfig];<br />
       if ( !pBuffer )<br />
        goto Exit;</font>
        </p>
        <p>
          <font face="Courier New"> ReadFile(hFile, pBuffer, cbConfig, &amp;cbConfig, NULL);<br />
       <br />
       LPCWSTR pOut;<br />
       LPWSTR pIn;<br />
       pIn = new WCHAR[cbConfig + 1];<br />
       ZeroMemory(pIn, (cbConfig+1) * 2);<br />
       mbstowcs(pIn, (LPCSTR)pBuffer, cbConfig);<br />
       HRESULT hr;<br />
       if ( FAILED(hr = CeProcessConfig(pIn, 1, &amp;pOut) ))<br />
       {<br />
        _tprintf(_T("Unable to process: %d\n"), hr);<br />
       }</font>
        </p>
        <p>
          <font face="Courier New"> HANDLE hFileOut = CreateFile(argv[2], GENERIC_WRITE,
      0, NULL, CREATE_ALWAYS, 0, NULL);<br />
       if ( hFileOut == INVALID_HANDLE_VALUE )<br />
       {<br />
        _tprintf(_T("Unable to create %s\n"), argv[2]);<br />
        goto Exit;<br />
       }</font>
        </p>
        <p>
          <font face="Courier New"> WriteFile(hFileOut, pOut, (wcslen(pOut) + 1 )* 2, &amp;cbConfig,
      NULL);</font>
        </p>
        <p>
          <font face="Courier New"> CloseHandle(hFileOut);<br />
       CeRapiFreeBuffer((LPVOID)pOut);</font>
        </p>
        <p>
          <font face="Courier New">Exit:<br />
       if ( hFile != INVALID_HANDLE_VALUE )<br />
        CloseHandle(hFile);</font>
        </p>
        <p>
          <font face="Courier New"> CeRapiUninit();<br />
       return 0;<br />
      }<br /></font>
        </p>
        <p>
       
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=bdea60e3-69db-4971-ab3a-ff5e293bcaee" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Running RTF Host (Compact Framework 3.5 Power Toys) on emulator</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,ac6cd193-d63c-4644-bf9a-7dd6f0b30c76.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,ac6cd193-d63c-4644-bf9a-7dd6f0b30c76.aspx</id>
    <published>2007-02-25T08:45:36.6440000-06:00</published>
    <updated>2008-02-26T08:45:36.6443750-06:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://blogs.ugidotnet.org/raffaele ">Raffaele Rialdi </a>pointed out that
      attempting to run RTF Host from Compact Framework 3.5 Power Toys on an emulator produces
      the following error:
   </p>
        <p>
          <img src="http://blog.opennetcf.org/afeinman/content/binary/RTFError.png" border="0" />
        </p>
        <p>
      This is caused by RTF getting confused because the default CoreCon transport on the
      emulator is DMA (DeviceDMA.dll). Here are the steps to add emulator as a manual Tcp
      connection. Not that many will need it, but it is useful for a demo
   </p>
        <p>
      1. Start Emulator using Device Emulator Manager.<br />
      2. Configure Network and Storage card folder<br />
      3. Copy to storage card folder the following file: "C:\Program Files\Common 
      <br />
      Files\microsoft shared\CoreCon\1.0\Target\wce400\armv4i\TCPConnectionA.dll"<br />
      4. In File ExplorerNavigate to \Windows\Corecon1.1. If you don't see it 
      <br />
      there, connect to the emulator from Studio<br />
      5. Launch ClientShutdown (you should see a guid-named folder to appear)<br />
      6. Copy \Storage Card\TcpConnectionA.dll to \Windows<br />
      7. Go to \Windows and delete DeviceDMA.dll (if you can't, you forgot to 
      <br />
      launch ClientShutdown)<br />
      8. Go back to \Windows\Corecon1.1 and launch ConmanClient.exe<br />
      9. Launch RTF Host. Enjoy<br /></p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=ac6cd193-d63c-4644-bf9a-7dd6f0b30c76" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Running RTF Host (Compact Framework 3.5 Power Toys) on emulator</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,fb3cfd88-2d46-4aa8-a89a-8df02b10b6bc.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,fb3cfd88-2d46-4aa8-a89a-8df02b10b6bc.aspx</id>
    <published>2007-02-25T06:55:18.9250000-06:00</published>
    <updated>2008-02-25T06:55:18.9256250-06:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://blogs.ugidotnet.org/raffaele">Raffaele Rialdi</a> has pointed
      out that trying to run RTF Host from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c8174c14-a27d-4148-bf01-86c2e0953eab&amp;DisplayLang=en">CF
      3.5 Power Toys </a>(required for manual connectivity) on a Windows Mobile emulator
      produces an error :
   </p>
        <p>
          <img src="http://blog.opennetcf.org/afeinman/content/binary/RTFError.png" border="0" />
        </p>
        <p>
      This is caused by RTF getting confused and trying to use DMA transport instead of
      TCP. Here are the steps to establish a manual RTF connection to an emulator (you don't
      really need it unless you are doing a demo)
   </p>
        <p>
      1. Start Emulator using Device Emulator Manager.<br /><br />
      2. Configure Network and Storage card folder<br /><br />
      3. Copy to storage card folder the following file: "C:\Program Files\Common 
      <br />
      Files\microsoft shared\CoreCon\1.0\Target\wce400\armv4i\TCPConnectionA.dll"<br /><br />
      4. In File ExplorerNavigate to \Windows\Corecon1.1. If you don't see it 
      <br />
      there, connect to the emulator from Studio<br /><br />
      5. Launch ClientShutdown (you should see a guid-named folder to appear)<br /><br />
      6. Copy \Storage Card\TcpConnectionA.dll to \Windows<br /><br />
      7. Go to \Windows and delete DeviceDMA.dll (if you can't, you forgot to 
      <br />
      launch ClientShutdown)<br /><br />
      8. Go back to \Windows\Corecon1.1 and launch ConmanClient.exe<br /><br />
      9. Launch RTF Host. Enjoy<br /></p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=fb3cfd88-2d46-4aa8-a89a-8df02b10b6bc" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Like father, like son?</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,1a67cdcb-72ed-458a-9825-e8e0f1a780c5.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,1a67cdcb-72ed-458a-9825-e8e0f1a780c5.aspx</id>
    <published>2007-02-05T00:18:21.2360000-06:00</published>
    <updated>2007-02-05T02:17:53.6740000-06:00</updated>
    <category term="Life" label="Life" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.imdb.com/rg/name-headshot/top_center/http://imdb.com/gallery/granitz/2967/Events/2967/RyanONeal_Grani_4799038_400.jpg?path=pgallery&amp;path_key=O%27Neal,%20Ryan" name="headshot">
          </a>
          <img src="http://blog.opennetcf.org/afeinman/content/binary/12m.jpg" border="0" /> Over
      the weekend actor <a href="http://www.imdb.com/name/nm0641939/">Ryan O'Neal </a>has
      been arrested on assault charges 
      <br />
      (allegedly assaulted his son, <a href="http://www.imdb.com/name/nm0641906/">Griffin
      O'Neal</a>)<br />
      (<a href="http://www.cnn.com/2007/SHOWBIZ/Movies/02/04/oneal.arrest/index.html?eref=rss_topstories">The
      news article is here</a>)
   </p>
        <p>
      From TFA:
   </p>
        <p>
          <em>    Ryan O'Neal's film credits include "Love Story," "Paper Moon,"
      "Green 
      <br />
      Ice" and "Barry Lyndon."</em>
        </p>
        <p>
      and further
   </p>
        <p>
          <em>    Griffin O'Neal appeared in a number of B-movies, including
      "</em>
          <a href="http://www.imdb.com/title/tt0092587/">
            <em>The Assault 
      <br />
      of the Killer Bimbos</em>
          </a>
          <em>."</em>
        </p>
        <p>
      I have to say that father's movie career impresses me somewhat more. I think 
      <br />
      under circumstances I would have slapped my offspring a few times too...<br /></p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=1a67cdcb-72ed-458a-9825-e8e0f1a780c5" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Frustrated? So is he.</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,b168f16d-5087-49ab-a4a5-58c63812107a.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,b168f16d-5087-49ab-a4a5-58c63812107a.aspx</id>
    <published>2006-12-07T16:34:46.0225528-06:00</published>
    <updated>2006-12-07T16:34:46.0225528-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I came across this picture while reading fark.com. It fairly well reflects my feelings
      about ... many things that happen in everyday life while working with people, companies,
      service providers etc.
   </p>
        <p>
       
   </p>
        <img src="http://blog.opennetcf.org/afeinman/content/binary/Bear.jpg" border="0" />
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=b168f16d-5087-49ab-a4a5-58c63812107a" />
      </div>
    </content>
  </entry>
</feed>