<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Damir Arh's Corner</title>
    <link>http://www.damirscorner.com/</link>
    <description />
    <language>en-us</language>
    <copyright>Damir Arh, M. Sc.</copyright>
    <lastBuildDate>Sat, 05 Jul 2008 20:37:14 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>damir.arh@gmail.com</managingEditor>
    <webMaster>damir.arh@gmail.com</webMaster>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=4e0955bd-674c-4a1f-b657-91a361e2c0eb</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,4e0955bd-674c-4a1f-b657-91a361e2c0eb.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,4e0955bd-674c-4a1f-b657-91a361e2c0eb.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=4e0955bd-674c-4a1f-b657-91a361e2c0eb</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://gama-system.com/Content.aspx?id=20050200">Gama System eArchive</a>,
      one of the two products in our <a href="http://gama-system.com/Content.aspx?id=20050050">document
      product line</a>, received accreditation from the <a href="http://www.arhiv.gov.si/en/">Archives
      of the Republic of Slovenia</a> last week. This acknowledgement by our national body
      means that any document stored in Gama System eArchive is automatically legally valid.
   </p>
        <p>
      This is important for both <a href="http://gama-system.com/NewsItems.aspx">our company</a> and
      other companies looking for a long term electronic document storage solution. Our
      product is the first service oriented solution to receive the accreditation.
   </p>
        <p>
      Congratulations to everyone involved in the product. Well done!
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=4e0955bd-674c-4a1f-b657-91a361e2c0eb" />
      </body>
      <title>Gama System eArchive accredited</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,4e0955bd-674c-4a1f-b657-91a361e2c0eb.aspx</guid>
      <link>http://www.damirscorner.com/GamaSystemEArchiveAccredited.aspx</link>
      <pubDate>Sat, 05 Jul 2008 20:37:14 GMT</pubDate>
      <description>&lt;p&gt;
   &lt;a href="http://gama-system.com/Content.aspx?id=20050200"&gt;Gama System eArchive&lt;/a&gt;,
   one of the two products in our &lt;a href="http://gama-system.com/Content.aspx?id=20050050"&gt;document
   product line&lt;/a&gt;, received accreditation from the &lt;a href="http://www.arhiv.gov.si/en/"&gt;Archives
   of the Republic of Slovenia&lt;/a&gt; last week. This acknowledgement by our national body
   means that any document stored in Gama System eArchive is automatically legally valid.
&lt;/p&gt;
&lt;p&gt;
   This is important for both &lt;a href="http://gama-system.com/NewsItems.aspx"&gt;our company&lt;/a&gt; and
   other companies looking for a long term electronic document storage solution. Our
   product is the first service oriented solution to receive the accreditation.
&lt;/p&gt;
&lt;p&gt;
   Congratulations to everyone involved in the product. Well done!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=4e0955bd-674c-4a1f-b657-91a361e2c0eb" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,4e0955bd-674c-4a1f-b657-91a361e2c0eb.aspx</comments>
      <category>Development;Development/.NET;Personal;Personal/Software</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=de988151-8abf-4eef-bdc2-1126b05812b1</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,de988151-8abf-4eef-bdc2-1126b05812b1.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,de988151-8abf-4eef-bdc2-1126b05812b1.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=de988151-8abf-4eef-bdc2-1126b05812b1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Today I've taken my new <a href="http://buy.garmin.com/shop/shop.do?pID=8703">handeld
      GPS device</a> for a test run. It did its job pretty well but the real challenge started
      afterwards when I tried geotagging the photos I've taken. I decided to use <a href="http://www.microsoft.com/prophoto/downloads/tools.aspx">Microsoft
      Pro Photo Tools</a> which have just been released with geotagging as its main feature.
      Downloading the track data from the GPS device with Garmin MapSource software was
      quick and simple. But the problems started soon afterwards. MapSource can only export
      track data in its proprietary format GDB which can't be used in Microsoft Pro Photo
      Tools.
   </p>
        <p>
          <a href="http://www.gpsbabel.org/">GPSBabel</a> came to the rescue. This free tool
      can probably convert files between any two existing GPS formats, at least judging
      from its <a href="http://www.gpsbabel.org/capabilities.html">list of supported formats</a>.
      I used it to convert my data to the GPX XML format only to find out that Microsoft
      Pro Photo Tools have problems with it. Converting to NMEA or KML instead didn't help
      either. Fortunately the latter returned a strange error (Degrees must be between 0
      and 90, found degree 46298501) which put me on the right track. Of course there was
      no such value in the KML file so I correctly deduced that the decimal separator was
      to blame.
   </p>
        <p>
      The value in the file was 46.298501 but the Slovenian regional settings have comma
      as the decimal separator therefore the value was misinterpreted. Temporarily changing
      the decimal separator to dot solved the problem - the track was successfully imported
      immediately afterwards. This issue won't keep me from using this otherwise very useful
      tool with a really nice feature set. It could even fix the mismatching time settings
      between my GPS unit and the camera with a single setting. I just hope they address
      this bug soon so that I won't have to change my regional settings every time I use
      the program.
   </p>
        <p>
      The only thing I still have to figure out is why the geotags somehow lost resolution
      when I uploaded the photos from <a href="http://picasa.google.com/">Picasa</a> to <a href="http://picasaweb.google.com/">Picasa
      Web Albums</a>. I just fixed them manually and decided to address the issue next time.
      Any tips are welcome.
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=de988151-8abf-4eef-bdc2-1126b05812b1" />
      </body>
      <title>Microsoft Pro Photo Tools decimal separator problem</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,de988151-8abf-4eef-bdc2-1126b05812b1.aspx</guid>
      <link>http://www.damirscorner.com/MicrosoftProPhotoToolsDecimalSeparatorProblem.aspx</link>
      <pubDate>Sun, 15 Jun 2008 20:03:01 GMT</pubDate>
      <description>&lt;p&gt;
   Today I've taken my new &lt;a href="http://buy.garmin.com/shop/shop.do?pID=8703"&gt;handeld
   GPS device&lt;/a&gt; for a test run. It did its job pretty well but the real challenge started
   afterwards when I tried geotagging the photos I've taken. I decided to use &lt;a href="http://www.microsoft.com/prophoto/downloads/tools.aspx"&gt;Microsoft
   Pro Photo Tools&lt;/a&gt; which have just been released with geotagging as its main feature.
   Downloading the track data from the GPS device with Garmin MapSource software was
   quick and simple. But the problems started soon afterwards. MapSource can only export
   track data in its proprietary format GDB which can't be used in Microsoft Pro Photo
   Tools.
&lt;/p&gt;
&lt;p&gt;
   &lt;a href="http://www.gpsbabel.org/"&gt;GPSBabel&lt;/a&gt; came to the rescue. This free tool
   can probably convert files between any two existing GPS formats, at least judging
   from its &lt;a href="http://www.gpsbabel.org/capabilities.html"&gt;list of supported formats&lt;/a&gt;.
   I used it to convert my data to the GPX XML format only to find out that Microsoft
   Pro Photo Tools have problems with it. Converting to NMEA or KML instead didn't help
   either. Fortunately the latter returned a strange error (Degrees must be between 0
   and 90, found degree 46298501) which put me on the right track. Of course there was
   no such value in the KML file so I correctly deduced that the decimal separator was
   to blame.
&lt;/p&gt;
&lt;p&gt;
   The value in the file was 46.298501 but the Slovenian regional settings have comma
   as the decimal separator therefore the value was misinterpreted. Temporarily changing
   the decimal separator to dot solved the problem - the track was successfully imported
   immediately afterwards. This issue won't keep me from using this otherwise very useful
   tool with a really nice feature set. It could even fix the mismatching time settings
   between my GPS unit and the camera with a single setting. I just hope they address
   this bug soon so that I won't have to change my regional settings every time I use
   the program.
&lt;/p&gt;
&lt;p&gt;
   The only thing I still have to figure out is why the geotags somehow lost resolution
   when I uploaded the photos from &lt;a href="http://picasa.google.com/"&gt;Picasa&lt;/a&gt; to &lt;a href="http://picasaweb.google.com/"&gt;Picasa
   Web Albums&lt;/a&gt;. I just fixed them manually and decided to address the issue next time.
   Any tips are welcome.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=de988151-8abf-4eef-bdc2-1126b05812b1" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,de988151-8abf-4eef-bdc2-1126b05812b1.aspx</comments>
      <category>Personal;Personal/Software</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=84c751f7-f67e-47f0-9def-3035b5333cf5</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,84c751f7-f67e-47f0-9def-3035b5333cf5.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,84c751f7-f67e-47f0-9def-3035b5333cf5.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=84c751f7-f67e-47f0-9def-3035b5333cf5</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      A .NET application in the company I work for recently started crashing under Windows
      Vista when trying to open a window implemented in an ActiveX DLL. Investigations showed
      that they were caused by an <font face="Courier New">AccessViolationException "Attempted
      to read or write protected memory. This is often an indication that other memory is
      corrupt."</font>. The cause was one of the ActiveX controls in the window. When instantited
      directly in a .NET Form the exception above was contained in a <font face="Courier New">TargetInvocationException
      "Unable to get the window handle for the '&lt;control name&gt;' control. Windowless
      ActiveX controls are not supported."</font>. Knowing that the control didn't suddenly
      turn windowless we dug deeper.
   </p>
        <p>
      It turned out that the problem appeared with .NET Framework 2.0 Service Pack 1. <a href="http://blogs.msdn.com/ed_maurer/archive/2007/12/14/nxcompat-and-the-c-compiler.aspx">Apparently</a> it
      caused the C# compiler in Visual Studio 2005 and later to set the <font face="Courier New">NXCOMPAT</font> bit
      for all build targets without an option to turn this new behavior off. For those who
      don't know, this means that DEP (data execution prevention) will kick in unless it
      is turned off completely in the operating system. This wouldn't be a big deal unless
      ATL before Visual Studio 2005 didn't have a <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=299397">bug</a> which
      caused the heap allocated memory not to be flagged as executable, which under the
      new circumstances results as the already mentioned exception. Windows XP has DEP turned
      off by default therefore everything still works but in Windows Vista it is turned
      on and prevents such application from functioning properly.
   </p>
        <p>
      The best solution would of course be to recompile the ActiveX controls in Visual Studio
      2005 or later but this might not be possible if they are supplied by a third party.
      In this case the most obvious approach to dealing with the situation is to disable
      DEP in Vista. There is a <font face="Courier New">Data Execution Prevention</font> tab
      in the <font face="Courier New">Performance Options</font> which open when you click
      the <font face="Courier New">Settings</font> button in the <font face="Courier New">Performance</font> frame
      of the <font face="Courier New">Advanced</font> tab in the <font face="Courier New">System
      Properties</font> dialog but it only allows switching between DEP for all processes
      with defined exceptions and DEP for essential Windows programs and services, i.e.
      executables flagged with the <font face="Courier New">NXCOMPAT</font> bit. The only
      way to turn DEP completely off is executing the following command with administrative
      privileges:
   </p>
        <p>
          <font face="Courier New">bcdedit.exe /set {current} nx AlwaysOff</font>
        </p>
        <p>
      After restart DEP will be turned off and problematic binaries will work once again.
      To restore the previous (default) state replace <font face="Courier New">AlwaysOff</font> with <font face="Courier New">OptIn</font>.
      The <font face="Courier New">AlwaysOn</font> option enables DEP for all processes
      and might cause additional problems (e.g. Google Calendar Sync in its current version
      0.9.3.2 doesn't work in this mode).
   </p>
        <p>
      Unfortunately, this solution would require all your Vista using customers to disable
      DEP as well which really isn't an option for commercial software. Fortunately, there
      is another solution. Although there is no compiler option to turn keep the <font face="Courier New">NXCOMPAT</font> bit
      unset, you can still do this after compilation using the <font face="Courier New">editbin.exe</font> which
      comes with C++ compiler for Visual Studio 2005 and later:
   </p>
        <p>
          <font face="Courier New">editbin.exe /NXCOMPAT:NO &lt;filename.exe&gt;</font>
        </p>
        <p>
      This command removes the <font face="Courier New">NXCOMPAT</font> bit and restores
      the behavior before .NET 2.0 SP1. If your assembly was signed it also invalidates
      the signature so you'll have to resign it:
   </p>
        <p>
          <font face="Courier New">sn.exe -R &lt;filename.exe&gt; &lt;keyfile.snk&gt;</font>
        </p>
        <p>
      You can automate this by putting the two commands in the <font face="Courier New">Post-build
      event command line</font> for the project:
   </p>
        <p>
          <font face="Courier New">editbin.exe /NXCOMPAT:NO "$(TargetPath)"<br />
      sn.exe -R "$(TargetPath)" "$(ProjectDir)&lt;keyfile.snk&gt;"</font>
        </p>
        <p>
      You might need to call <font face="Courier New">vcvars32.bat</font> before that to
      put the required executables in path and enable <font face="Courier New">editbin.exe</font> dependencies
      to be resolved. Note that in a completely automated build scenario using <font face="Courier New">MSBuild</font> you'll
      have to specify full path for the <font face="Courier New">vcvars32.bat</font> because <font face="Courier New">$(DevEnvDir)</font> resolves
      to <font face="Courier New">*Undefined*</font> outside Visual Studio 2005. Also your
      strong name key should be in a <font face="Courier New">snk</font> file instead of
      a password protected <font face="Courier New">pfx</font> file because <font face="Courier New">sn.exe</font><a href="http://blogs.msdn.com/shawnfa/archive/2006/02/14/531921.aspx">doesn't
      allow</a> the password to be read from a redirected standard input.
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=84c751f7-f67e-47f0-9def-3035b5333cf5" />
      </body>
      <title>Old ActiveX controls under .NET 2.0 SP1</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,84c751f7-f67e-47f0-9def-3035b5333cf5.aspx</guid>
      <link>http://www.damirscorner.com/OldActiveXControlsUnderNET20SP1.aspx</link>
      <pubDate>Tue, 29 Apr 2008 13:29:08 GMT</pubDate>
      <description>&lt;p&gt;
   A .NET application in the company I work for recently started crashing under Windows
   Vista when trying to open a window implemented in an ActiveX DLL. Investigations showed
   that they were caused by an &lt;font face="Courier New"&gt;AccessViolationException "Attempted
   to read or write protected memory. This is often an indication that other memory is
   corrupt."&lt;/font&gt;. The cause was one of the ActiveX controls in the window. When instantited
   directly in a .NET Form the exception above was contained in a &lt;font face="Courier New"&gt;TargetInvocationException
   "Unable to get the window handle for the '&amp;lt;control name&amp;gt;' control. Windowless
   ActiveX controls are not supported."&lt;/font&gt;. Knowing that the control didn't suddenly
   turn windowless we dug deeper.
&lt;/p&gt;
&lt;p&gt;
   It turned out that the problem appeared with .NET Framework 2.0 Service Pack 1. &lt;a href="http://blogs.msdn.com/ed_maurer/archive/2007/12/14/nxcompat-and-the-c-compiler.aspx"&gt;Apparently&lt;/a&gt; it
   caused the C# compiler in Visual Studio 2005 and later to set the &lt;font face="Courier New"&gt;NXCOMPAT&lt;/font&gt; bit
   for all build targets without an option to turn this new behavior off. For those who
   don't know, this means that DEP (data execution prevention) will kick in unless it
   is turned off completely in the operating system. This wouldn't be a big deal unless
   ATL before Visual Studio 2005 didn't have a &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=299397"&gt;bug&lt;/a&gt; which
   caused the heap allocated memory not to be flagged as executable, which under the
   new circumstances results as the already mentioned exception. Windows XP has DEP turned
   off by default therefore everything still works but in Windows Vista it is turned
   on and prevents such application from functioning properly.
&lt;/p&gt;
&lt;p&gt;
   The best solution would of course be to recompile the ActiveX controls in Visual Studio
   2005 or later but this might not be possible if they are supplied by a third party.
   In this case the most obvious approach to dealing with the situation is to disable
   DEP in Vista. There is a &lt;font face="Courier New"&gt;Data Execution Prevention&lt;/font&gt; tab
   in the &lt;font face="Courier New"&gt;Performance Options&lt;/font&gt; which open when you click
   the &lt;font face="Courier New"&gt;Settings&lt;/font&gt; button in the &lt;font face="Courier New"&gt;Performance&lt;/font&gt; frame
   of the &lt;font face="Courier New"&gt;Advanced&lt;/font&gt; tab in the &lt;font face="Courier New"&gt;System
   Properties&lt;/font&gt; dialog but it only allows switching between DEP for all processes
   with defined exceptions and DEP for essential Windows programs and services, i.e.
   executables flagged with the &lt;font face="Courier New"&gt;NXCOMPAT&lt;/font&gt; bit. The only
   way to turn DEP completely off is executing the following command with administrative
   privileges:
&lt;/p&gt;
&lt;p&gt;
   &lt;font face="Courier New"&gt;bcdedit.exe /set {current} nx AlwaysOff&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
   After restart DEP will be turned off and problematic binaries will work once again.
   To restore the previous (default) state replace &lt;font face="Courier New"&gt;AlwaysOff&lt;/font&gt; with &lt;font face="Courier New"&gt;OptIn&lt;/font&gt;.
   The &lt;font face="Courier New"&gt;AlwaysOn&lt;/font&gt; option enables DEP for all processes
   and might cause additional problems (e.g. Google Calendar Sync in its current version
   0.9.3.2 doesn't work in this mode).
&lt;/p&gt;
&lt;p&gt;
   Unfortunately, this solution would require all your Vista using customers to disable
   DEP as well which really isn't an option for commercial software. Fortunately, there
   is another solution. Although there is no compiler option to turn keep the &lt;font face="Courier New"&gt;NXCOMPAT&lt;/font&gt; bit
   unset, you can still do this after compilation using the &lt;font face="Courier New"&gt;editbin.exe&lt;/font&gt; which
   comes with C++ compiler for Visual Studio 2005 and later:
&lt;/p&gt;
&lt;p&gt;
   &lt;font face="Courier New"&gt;editbin.exe /NXCOMPAT:NO &amp;lt;filename.exe&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
   This command removes the &lt;font face="Courier New"&gt;NXCOMPAT&lt;/font&gt; bit and restores
   the behavior before .NET 2.0 SP1. If your assembly was signed it also invalidates
   the signature so you'll have to resign it:
&lt;/p&gt;
&lt;p&gt;
   &lt;font face="Courier New"&gt;sn.exe -R &amp;lt;filename.exe&amp;gt; &amp;lt;keyfile.snk&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
   You can automate this by putting the two commands in the &lt;font face="Courier New"&gt;Post-build
   event command line&lt;/font&gt; for the project:
&lt;/p&gt;
&lt;p&gt;
   &lt;font face="Courier New"&gt;editbin.exe /NXCOMPAT:NO "$(TargetPath)"&lt;br&gt;
   sn.exe -R "$(TargetPath)" "$(ProjectDir)&amp;lt;keyfile.snk&amp;gt;"&lt;/font&gt; 
&lt;p&gt;
   You might need to call &lt;font face="Courier New"&gt;vcvars32.bat&lt;/font&gt; before that to
   put the required executables in path and enable &lt;font face="Courier New"&gt;editbin.exe&lt;/font&gt; dependencies
   to be resolved. Note that in a completely automated build scenario using &lt;font face="Courier New"&gt;MSBuild&lt;/font&gt; you'll
   have to specify full path for the &lt;font face="Courier New"&gt;vcvars32.bat&lt;/font&gt; because &lt;font face="Courier New"&gt;$(DevEnvDir)&lt;/font&gt; resolves
   to &lt;font face="Courier New"&gt;*Undefined*&lt;/font&gt; outside Visual Studio 2005. Also your
   strong name key should be in a &lt;font face="Courier New"&gt;snk&lt;/font&gt; file instead of
   a password protected &lt;font face="Courier New"&gt;pfx&lt;/font&gt; file because &lt;font face="Courier New"&gt;sn.exe&lt;/font&gt; &lt;a href="http://blogs.msdn.com/shawnfa/archive/2006/02/14/531921.aspx"&gt;doesn't
   allow&lt;/a&gt; the password to be read from a redirected standard input.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=84c751f7-f67e-47f0-9def-3035b5333cf5" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,84c751f7-f67e-47f0-9def-3035b5333cf5.aspx</comments>
      <category>Development;Development/.NET;Development/Vista</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=ec1b3869-796e-4d12-8d41-614bcb51aad5</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,ec1b3869-796e-4d12-8d41-614bcb51aad5.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,ec1b3869-796e-4d12-8d41-614bcb51aad5.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ec1b3869-796e-4d12-8d41-614bcb51aad5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      The <font face="Courier New">MonthCalendar</font> control's <font face="Courier New">BoldedDates</font> functionality
      doesn't appear to work properly on Windows Vista. The dates added to any of the <font face="Courier New">BoldedDates</font>, <font face="Courier New">MonthlyBoldedDates</font> and <font face="Courier New">AnnuallyBoldedDates</font> collections
      are rendered just the same as those not added to any of the collections. The same
      code works just fine on Windows XP and causes those dates to be rendered bold. The
      only workaround i've managed to <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2296827&amp;SiteID=1">find</a> is
      disabling visual styles in the application, i.e. commenting out the first line in
      the <font face="Courier New">Program.Main()</font> method of a new Windows Application:
   </p>
        <p>
          <font face="Courier New">Application.EnableVisualStyles();</font>
        </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=ec1b3869-796e-4d12-8d41-614bcb51aad5" />
      </body>
      <title>MonthCalendar BoldedDates in Windows Vista</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,ec1b3869-796e-4d12-8d41-614bcb51aad5.aspx</guid>
      <link>http://www.damirscorner.com/MonthCalendarBoldedDatesInWindowsVista.aspx</link>
      <pubDate>Mon, 14 Apr 2008 19:54:58 GMT</pubDate>
      <description>&lt;p&gt;
   The &lt;font face="Courier New"&gt;MonthCalendar&lt;/font&gt; control's &lt;font face="Courier New"&gt;BoldedDates&lt;/font&gt; functionality
   doesn't appear to work properly on Windows Vista. The dates added to any of the &lt;font face="Courier New"&gt;BoldedDates&lt;/font&gt;, &lt;font face="Courier New"&gt;MonthlyBoldedDates&lt;/font&gt; and &lt;font face="Courier New"&gt;AnnuallyBoldedDates&lt;/font&gt; collections
   are rendered just the same as those not added to any of the collections. The same
   code works just fine on Windows XP and causes those dates to be rendered bold. The
   only workaround i've managed to &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2296827&amp;amp;SiteID=1"&gt;find&lt;/a&gt; is
   disabling visual styles in the application, i.e. commenting out the first line in
   the &lt;font face="Courier New"&gt;Program.Main()&lt;/font&gt; method of a new Windows Application:
&lt;/p&gt;
&lt;p&gt;
   &lt;font face="Courier New"&gt;Application.EnableVisualStyles();&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=ec1b3869-796e-4d12-8d41-614bcb51aad5" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,ec1b3869-796e-4d12-8d41-614bcb51aad5.aspx</comments>
      <category>Development;Development/.NET;Development/Vista</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=fcd08df4-c6f8-4a1f-ae1f-c5ed70431510</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,fcd08df4-c6f8-4a1f-ae1f-c5ed70431510.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,fcd08df4-c6f8-4a1f-ae1f-c5ed70431510.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=fcd08df4-c6f8-4a1f-ae1f-c5ed70431510</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      The Xbox 360 Dashboard update released on 4th December 2007 added support for playing
      DivX and XviD videos natively, i.e. without installing <a href="http://www.runtime360.com/projects/transcode-360/">Transcode
      360</a> for Windows Media Center. Unfortunatelly this only works for media played
      directly from the dashboard and not within Media Center Extender. Since I didn't want
      to copy my videos to CDs, DVDs or other external devices, the only thing left to do
      was to setup Windows Media Player media sharing which I never had to use before.
   </p>
        <p>
      This turned out to be more difficult than I expected - the reason being that the media
      I wanted to share wasn't stored locally but on a separate file server. By default
      such media is not shared and there are few steps one has to follow to make this work,
      as thoroughly explained <a href="http://www.microsoft.com/windows/windowsmedia/player/faq/sharing.mspx#q20_17">here</a>:
   </p>
        <ul>
          <li>
         Enable remote content sharing by adding the following entry into the registry:<br /><font face="Courier New">[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\Preferences\HME]<br />
         "EnableRemoteContentSharing"=dword:00000001</font></li>
          <li>
         Grant anonymous users access to the shared folders on the file server by adding the
         read permission on the folder and on the share to the <font face="Courier New">ANONYMOUS
         LOGON</font> user 
      </li>
          <li>
         Modify the file server's group policy to allow anonymous access to the selected shares
         by listing them in the <font face="Courier New">Network access: Shares that can be
         accessed anonymously</font> policy in the <font face="Courier New">Computer Configuration,
         Windows Settings, Security Settings, Local Policies, Security Options</font> branch
         of the group policy tree (just run <font face="Courier New">gpedit.msc</font> to start
         the Group Policy Object Editor)</li>
        </ul>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=fcd08df4-c6f8-4a1f-ae1f-c5ed70431510" />
      </body>
      <title>Playing DivX and XviD videos natively on Xbox 360</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,fcd08df4-c6f8-4a1f-ae1f-c5ed70431510.aspx</guid>
      <link>http://www.damirscorner.com/PlayingDivXAndXviDVideosNativelyOnXbox360.aspx</link>
      <pubDate>Mon, 31 Dec 2007 11:34:14 GMT</pubDate>
      <description>&lt;p&gt;
   The Xbox 360 Dashboard update released on 4th December 2007 added support for playing
   DivX and XviD videos natively, i.e. without installing &lt;a href="http://www.runtime360.com/projects/transcode-360/"&gt;Transcode
   360&lt;/a&gt; for Windows Media Center. Unfortunatelly this only works for media played
   directly from the dashboard and not within Media Center Extender. Since I didn't want
   to copy my videos to CDs, DVDs or other external devices, the only thing left to do
   was to setup Windows Media Player media sharing which I never had to use before.
&lt;/p&gt;
&lt;p&gt;
   This turned out to be more difficult than I expected - the reason being that the media
   I wanted to share wasn't stored locally but on a separate file server. By default
   such media is not shared and there are few steps one has to follow to make this work,
   as thoroughly explained &lt;a href="http://www.microsoft.com/windows/windowsmedia/player/faq/sharing.mspx#q20_17"&gt;here&lt;/a&gt;:
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      Enable remote content sharing by adding the following entry into the registry:&lt;br&gt;
      &lt;font face="Courier New"&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\Preferences\HME]&lt;br&gt;
      "EnableRemoteContentSharing"=dword:00000001&lt;/font&gt; 
   &lt;li&gt;
      Grant anonymous users access to the shared folders on the file server by adding the
      read permission on the folder and on the share to the &lt;font face="Courier New"&gt;ANONYMOUS
      LOGON&lt;/font&gt; user 
   &lt;li&gt;
      Modify the file server's group policy to allow anonymous access to the selected shares
      by listing them in the &lt;font face="Courier New"&gt;Network access: Shares that can be
      accessed anonymously&lt;/font&gt; policy in the &lt;font face="Courier New"&gt;Computer Configuration,
      Windows Settings, Security Settings, Local Policies, Security Options&lt;/font&gt; branch
      of the group policy tree (just run &lt;font face="Courier New"&gt;gpedit.msc&lt;/font&gt; to start
      the Group Policy Object Editor)&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=fcd08df4-c6f8-4a1f-ae1f-c5ed70431510" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,fcd08df4-c6f8-4a1f-ae1f-c5ed70431510.aspx</comments>
      <category>Personal;Personal/Software</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=eeb23ba8-38df-4a7b-8b2e-3fd5132e8a18</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,eeb23ba8-38df-4a7b-8b2e-3fd5132e8a18.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,eeb23ba8-38df-4a7b-8b2e-3fd5132e8a18.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=eeb23ba8-38df-4a7b-8b2e-3fd5132e8a18</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      In my opinion RSACryptoServiceProvider class is seriously under-documented in MSDN.
      Since there is also no abundance of examples on the web, I spent more time than I
      should figuring out how to use it correctly. For future reference I'm listing below
      the solution to two problems I had.
   </p>
        <p>
      The maximum byte array length for encrypting without OAEP padding is Modulus size
      - 11 which is written somewhere in the <a href="http://msdn2.microsoft.com/en-us/library/system.security.cryptography.rsacryptoserviceprovider.encrypt.aspx">Encrypt()
      method documentation</a>. If you pass it a larger array it will return a not so informative
      Unspecified error. To encrypt a larger chunk of data you have to split it in smaller
      parts, encrypt them individually and concatenate them back together. You have to do
      the same when decrypting the data, with the only difference that each part has the
      size of Modulus in stead of Modulus - 11. To get the modulus size you can use the
      following piece of code (rsa is an instance of RSACryptoServiceProvider):
   </p>
        <div class="CodeFormatContainer">
          <pre class="csharpcode">RSAParameters rsaParams = rsa.ExportParameters(<span class="kwrd">false</span>); <span class="kwrd">int</span> modulusSize
      = rsaParams.Modulus.Length; </pre>
        </div>
        <p>
      Each time you instantiate RSACryptoServiceProvider it generates a new pair of keys.
      If you want to use existing ones, you can import them by calling:
   </p>
        <div class="CodeFormatContainer">
          <pre class="csharpcode">rsa.FromXmlString(key);</pre>
        </div>
        <p>
      The key parameter is a string with the XML representation of the keys. You can get
      it by calling the ToXmlString() method once and storing its results. It's only parameter
      specifies whether to also export the private key. I guess I don't have to remind you
      that you need the private key only for decryption and that you should always keep
      it private for the encryption to make any sense at all. 
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=eeb23ba8-38df-4a7b-8b2e-3fd5132e8a18" />
      </body>
      <title>Notes about RSACryptoServiceProvider</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,eeb23ba8-38df-4a7b-8b2e-3fd5132e8a18.aspx</guid>
      <link>http://www.damirscorner.com/NotesAboutRSACryptoServiceProvider.aspx</link>
      <pubDate>Sat, 24 Nov 2007 16:31:53 GMT</pubDate>
      <description>&lt;p&gt;
   In my opinion RSACryptoServiceProvider class is seriously under-documented in MSDN.
   Since there is also no abundance of examples on the web, I spent more time than I
   should figuring out how to use it correctly. For future reference I'm listing below
   the solution to two problems I had.
&lt;/p&gt;
&lt;p&gt;
   The maximum byte array length for encrypting without OAEP padding is Modulus size
   - 11 which is written somewhere in the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.security.cryptography.rsacryptoserviceprovider.encrypt.aspx"&gt;Encrypt()
   method documentation&lt;/a&gt;. If you pass it a larger array it will return a not so informative
   Unspecified error. To encrypt a larger chunk of data you have to split it in smaller
   parts, encrypt them individually and concatenate them back together. You have to do
   the same when decrypting the data, with the only difference that each part has the
   size of Modulus in stead of Modulus - 11. To get the modulus size you can use the
   following piece of code (rsa is an instance of RSACryptoServiceProvider):
&lt;/p&gt;
&lt;div class="CodeFormatContainer"&gt;&lt;pre class="csharpcode"&gt;RSAParameters rsaParams = rsa.ExportParameters(&lt;span class="kwrd"&gt;false&lt;/span&gt;); &lt;span class="kwrd"&gt;int&lt;/span&gt; modulusSize
   = rsaParams.Modulus.Length; &lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
   Each time you instantiate RSACryptoServiceProvider it generates a new pair of keys.
   If you want to use existing ones, you can import them by calling:
&lt;/p&gt;
&lt;div class="CodeFormatContainer"&gt;&lt;pre class="csharpcode"&gt;rsa.FromXmlString(key);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
   The key parameter is a string with the XML representation of the keys. You can get
   it by calling the ToXmlString() method once and storing its results. It's only parameter
   specifies whether to also export the private key. I guess I don't have to remind you
   that you need the private key only for decryption and that you should always keep
   it private for the encryption to make any sense at all. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=eeb23ba8-38df-4a7b-8b2e-3fd5132e8a18" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,eeb23ba8-38df-4a7b-8b2e-3fd5132e8a18.aspx</comments>
      <category>Development;Development/.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=52003afd-e963-49d3-a950-388855fed432</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,52003afd-e963-49d3-a950-388855fed432.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,52003afd-e963-49d3-a950-388855fed432.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=52003afd-e963-49d3-a950-388855fed432</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Is the code below correct? Will inputString and outputString be equal?
   </p>
        <div class="CodeFormatContainer">
          <div class="CodeFormatContainer">
            <pre class="csharpcode">
              <span class="kwrd">string</span> inputString
         = <span class="str">"The text to compress and decompress"</span>; <span class="kwrd">byte</span>[]
         inputArray = Encoding.UTF8.GetBytes(inputString); MemoryStream stream = <span class="kwrd">new</span> MemoryStream();
         DeflateStream compressionStream = <span class="kwrd">new</span> DeflateStream(stream,
         CompressionMode.Compress); compressionStream.Write(inputArray, 0, inputArray.Length);
         compressionStream.Flush(); stream.Position = 0; DeflateStream decompressionStream
         = <span class="kwrd">new</span> DeflateStream(stream, CompressionMode.Decompress); <span class="kwrd">byte</span>[]
         outputArray = <span class="kwrd">new</span><span class="kwrd">byte</span>[inputArray.Length];
         decompressionStream.Read(outputArray, 0, outputArray.Length); <span class="kwrd">string</span> outputString
         = Encoding.UTF8.GetString(outputArray); Console.WriteLine(outputString == inputString);
         Console.ReadLine(); </pre>
          </div>
        </div>
        <p>
      As it turns out, they won't. The reason for it being that compressionStream.Close()
      was not called before reading from stream started. Calling compressionStream.Flush()
      is not enough in this case. I haven't managed to find this documented anywhere but
      the example in the <a href="http://msdn2.microsoft.com/en-us/library/system.io.compression.deflatestream.aspx">DeflateStream
      documentation</a> does it correctly. You can find the fixed code below. Notice the
      additional last parameter in the first call to the DeflateStream constructor. Without
      it stream will also be closed when compressionStream gets closed.
   </p>
        <div class="CodeFormatContainer">
          <div class="CodeFormatContainer">
            <pre class="csharpcode">
              <span class="kwrd">string</span> inputString
         = <span class="str">"The text to compress and decompress"</span>; <span class="kwrd">byte</span>[]
         inputArray = Encoding.UTF8.GetBytes(inputString); MemoryStream stream = <span class="kwrd">new</span> MemoryStream();
         DeflateStream compressionStream = <span class="kwrd">new</span> DeflateStream(stream,
         CompressionMode.Compress, <span class="kwrd">true</span>); compressionStream.Write(inputArray,
         0, inputArray.Length); compressionStream.Close(); stream.Position = 0; DeflateStream
         decompressionStream = <span class="kwrd">new</span> DeflateStream(stream, CompressionMode.Decompress); <span class="kwrd">byte</span>[]
         outputArray = <span class="kwrd">new</span><span class="kwrd">byte</span>[inputArray.Length];
         decompressionStream.Read(outputArray, 0, outputArray.Length); <span class="kwrd">string</span> outputString
         = Encoding.UTF8.GetString(outputArray); Console.WriteLine(outputString == inputString);
         Console.ReadLine(); </pre>
          </div>
        </div>
        <p>
      Thanks once again to my coworker for suggesting this when I was already running out
      of ideas.
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=52003afd-e963-49d3-a950-388855fed432" />
      </body>
      <title>Always close DeflateStream before reading results</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,52003afd-e963-49d3-a950-388855fed432.aspx</guid>
      <link>http://www.damirscorner.com/AlwaysCloseDeflateStreamBeforeReadingResults.aspx</link>
      <pubDate>Sat, 24 Nov 2007 15:44:37 GMT</pubDate>
      <description>&lt;p&gt;
   Is the code below correct? Will inputString and outputString be equal?
&lt;/p&gt;
&lt;div class="CodeFormatContainer"&gt;
   &lt;div class="CodeFormatContainer"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; inputString
      = &lt;span class="str"&gt;"The text to compress and decompress"&lt;/span&gt;; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[]
      inputArray = Encoding.UTF8.GetBytes(inputString); MemoryStream stream = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream();
      DeflateStream compressionStream = &lt;span class="kwrd"&gt;new&lt;/span&gt; DeflateStream(stream,
      CompressionMode.Compress); compressionStream.Write(inputArray, 0, inputArray.Length);
      compressionStream.Flush(); stream.Position = 0; DeflateStream decompressionStream
      = &lt;span class="kwrd"&gt;new&lt;/span&gt; DeflateStream(stream, CompressionMode.Decompress); &lt;span class="kwrd"&gt;byte&lt;/span&gt;[]
      outputArray = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[inputArray.Length];
      decompressionStream.Read(outputArray, 0, outputArray.Length); &lt;span class="kwrd"&gt;string&lt;/span&gt; outputString
      = Encoding.UTF8.GetString(outputArray); Console.WriteLine(outputString == inputString);
      Console.ReadLine(); &lt;/pre&gt;
   &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
   As it turns out, they won't. The reason for it being that compressionStream.Close()
   was not called before reading from stream started. Calling compressionStream.Flush()
   is not enough in this case. I haven't managed to find this documented anywhere but
   the example in the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.compression.deflatestream.aspx"&gt;DeflateStream
   documentation&lt;/a&gt; does it correctly. You can find the fixed code below. Notice the
   additional last parameter in the first call to the DeflateStream constructor. Without
   it stream will also be closed when compressionStream gets closed.
&lt;/p&gt;
&lt;div class="CodeFormatContainer"&gt;
   &lt;div class="CodeFormatContainer"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; inputString
      = &lt;span class="str"&gt;"The text to compress and decompress"&lt;/span&gt;; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[]
      inputArray = Encoding.UTF8.GetBytes(inputString); MemoryStream stream = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream();
      DeflateStream compressionStream = &lt;span class="kwrd"&gt;new&lt;/span&gt; DeflateStream(stream,
      CompressionMode.Compress, &lt;span class="kwrd"&gt;true&lt;/span&gt;); compressionStream.Write(inputArray,
      0, inputArray.Length); compressionStream.Close(); stream.Position = 0; DeflateStream
      decompressionStream = &lt;span class="kwrd"&gt;new&lt;/span&gt; DeflateStream(stream, CompressionMode.Decompress); &lt;span class="kwrd"&gt;byte&lt;/span&gt;[]
      outputArray = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[inputArray.Length];
      decompressionStream.Read(outputArray, 0, outputArray.Length); &lt;span class="kwrd"&gt;string&lt;/span&gt; outputString
      = Encoding.UTF8.GetString(outputArray); Console.WriteLine(outputString == inputString);
      Console.ReadLine(); &lt;/pre&gt;
   &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
   Thanks once again to my coworker for suggesting this when I was already running out
   of ideas.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=52003afd-e963-49d3-a950-388855fed432" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,52003afd-e963-49d3-a950-388855fed432.aspx</comments>
      <category>Development;Development/.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=90fc52c2-c73a-4709-900b-6f96fb4c9f1e</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,90fc52c2-c73a-4709-900b-6f96fb4c9f1e.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,90fc52c2-c73a-4709-900b-6f96fb4c9f1e.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=90fc52c2-c73a-4709-900b-6f96fb4c9f1e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Not so long ago I've been called to my boss's office to prevent him losing unsaved
      work in a PowerPoint presentation. It turned out that when he tried to save the file
      to a new location the message box with the overwrite warning for some reason didn't
      render completely and it was impossible to close it. As it turned out at the end I
      could have just killed the application and restart it, since the AutoRecover feature
      kicked in and offered a version of the file with all changes applied.
   </p>
        <p>
      But just to be on the save side I wanted to copy the AutoRecover files to a save location
      before actually killing the application. But unlike Word or Excel where the location
      of these files is set in the options, PowerPoint does not have such an option. After
      some googling I finally stumbled across <a href="http://office.microsoft.com/en-us/help/HA101578851033.aspx">a
      page</a>, correctly stating that the files are stored in the %temp% folder and named
      ppt*.tmp. I decided to publish this info here just in case I need it again.
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=90fc52c2-c73a-4709-900b-6f96fb4c9f1e" />
      </body>
      <title>Location of PowerPoint AutoRecover files</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,90fc52c2-c73a-4709-900b-6f96fb4c9f1e.aspx</guid>
      <link>http://www.damirscorner.com/LocationOfPowerPointAutoRecoverFiles.aspx</link>
      <pubDate>Sat, 24 Nov 2007 14:11:03 GMT</pubDate>
      <description>&lt;p&gt;
   Not so long ago I've been called to my boss's office to prevent him losing unsaved
   work in a PowerPoint presentation. It turned out that when he tried to save the file
   to a new location the message box with the overwrite warning for some reason didn't
   render completely and it was impossible to close it. As it turned out at the end I
   could have just killed the application and restart it, since the AutoRecover feature
   kicked in and offered a version of the file with all changes applied.
&lt;/p&gt;
&lt;p&gt;
   But just to be on the save side I wanted to copy the AutoRecover files to a save location
   before actually killing the application. But unlike Word or Excel where the location
   of these files is set in the options, PowerPoint does not have such an option. After
   some googling I finally stumbled across &lt;a href="http://office.microsoft.com/en-us/help/HA101578851033.aspx"&gt;a
   page&lt;/a&gt;, correctly stating that the files are stored in the %temp% folder and named
   ppt*.tmp. I decided to publish this info here just in case I need it again.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=90fc52c2-c73a-4709-900b-6f96fb4c9f1e" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,90fc52c2-c73a-4709-900b-6f96fb4c9f1e.aspx</comments>
      <category>Personal;Personal/Software</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=6440be26-d6e9-4d14-91f2-6f1d9c2831bd</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,6440be26-d6e9-4d14-91f2-6f1d9c2831bd.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,6440be26-d6e9-4d14-91f2-6f1d9c2831bd.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=6440be26-d6e9-4d14-91f2-6f1d9c2831bd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Figuring this out took me much longer than it should. The following line in a batch
      file will execute a command for each file in a directory:
   </p>
        <div class="CodeFormatContainer">
          <pre class="csharpcode">
            <span class="kwrd">for</span> %%I <span class="kwrd">in</span> (C:\*.*) <span class="kwrd">do</span> echo
      %%~nxI</pre>
        </div>
        <p>
      I had to overcome two obstacles to make this work:
   </p>
        <ul>
          <li>
         When including the command in a batch file the % characters must be duplicated in
         comparison to the syntax for executing the command directly from the
         command line.</li>
          <li>
         The ~nx prefix to the variable name causes only the filename with extension to be
         used instead of the complete path.</li>
        </ul>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=6440be26-d6e9-4d14-91f2-6f1d9c2831bd" />
      </body>
      <title>Loop over files in directory from a batch file</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,6440be26-d6e9-4d14-91f2-6f1d9c2831bd.aspx</guid>
      <link>http://www.damirscorner.com/LoopOverFilesInDirectoryFromABatchFile.aspx</link>
      <pubDate>Tue, 24 Jul 2007 14:19:03 GMT</pubDate>
      <description>&lt;p&gt;
   Figuring this out took me much longer than it should. The following line in a batch
   file will execute a command for each file in a directory:
&lt;/p&gt;
&lt;div class="CodeFormatContainer"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;for&lt;/span&gt; %%I &lt;span class="kwrd"&gt;in&lt;/span&gt; (C:\*.*) &lt;span class="kwrd"&gt;do&lt;/span&gt; echo
   %%~nxI&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
   I had to overcome two obstacles to make this work:
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      When including the command in a batch file the % characters must be duplicated in
      comparison to the syntax&amp;nbsp;for executing the command directly&amp;nbsp;from&amp;nbsp;the
      command line.&lt;/li&gt;
   &lt;li&gt;
      The ~nx prefix to the variable name causes only the filename with extension to be
      used instead of the complete path.&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=6440be26-d6e9-4d14-91f2-6f1d9c2831bd" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,6440be26-d6e9-4d14-91f2-6f1d9c2831bd.aspx</comments>
      <category>Development;Development/Batch</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=8e8055e2-dda6-43e2-850b-8a17419a94b2</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,8e8055e2-dda6-43e2-850b-8a17419a94b2.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,8e8055e2-dda6-43e2-850b-8a17419a94b2.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=8e8055e2-dda6-43e2-850b-8a17419a94b2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Once you start putting <a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET">CruiseControl.NET</a> to
      production use you'll sooner or later encounter the need for custom build tasks. There's
      only a limited set of them in the package and <a href="http://confluence.public.thoughtworks.org/display/CCNET/Executable+Task">Executable
      Task</a> can only do so much. Unfortunately there is not much information available
      on development of custom tasks. Your best sources will be:
   </p>
        <ul>
          <li>
            <a href="http://confluence.public.thoughtworks.org/display/CCNET/Documentation">Online
         documentation</a> contains <a href="http://confluence.public.thoughtworks.org/display/CCNET/Custom+Builder+Plug-in">an
         article on the subject</a> describing the first steps to get you going. It should
         be your first stop.</li>
          <li>
         There's <a href="http://blogs.the-collins.net/Josh/archive/2007/04/01/AdventuresInCCNet.aspx">a
         high level architectural overview</a> of a simple task available at Josh's Blog.</li>
          <li>
         Lutz Roeder's <a href="http://www.aisto.com/roeder/dotnet/">Reflector for .NET</a> will
         be your best friend. The source of the tasks in ThoughtWorks.CruiseControl.Core will
         soon become your best resource.</li>
        </ul>
        <p>
      Apart from that I feel obliged to mention a few of the most important points I've
      come across during the development of a few custom tasks:
   </p>
        <ul>
          <li>
         ThoughtWorks.CruiseControl.Core.Util.ProcessExecutor is a nice little wrapper around
         System.Diagnostics.Process class you'll end up using quite a lot.</li>
          <li>
         You can add your own information to the build log by calling AddTaskResult on the
         IIntegrationResult instance passed to your ITask.Run method. There are two overloads
         available: one accepting a System.String and another one accepting ITaskResult to
         which you can pass a new FileTaskResult instance to quickly include a complete file.</li>
          <li>
         If you're doing any checkins to your source control system as a part of the build
         you should call the MarkStartTime method of your IIntegrationResult instance afterwards to
         prevent triggering another build of the same project by setting the last build start
         time after the last checkin time.</li>
          <li>
         Make sure you use a unique ReflectorType name for your task. The service will just
         silently fail to start in case of a duplicate value.</li>
        </ul>
        <p>
      This information should make your first attempts at making your own custom
      task a little easier.
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=8e8055e2-dda6-43e2-850b-8a17419a94b2" />
      </body>
      <title>Creating custom tasks for CruiseControl.NET</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,8e8055e2-dda6-43e2-850b-8a17419a94b2.aspx</guid>
      <link>http://www.damirscorner.com/CreatingCustomTasksForCruiseControlNET.aspx</link>
      <pubDate>Tue, 24 Jul 2007 11:57:26 GMT</pubDate>
      <description>&lt;p&gt;
   Once you start putting &lt;a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET"&gt;CruiseControl.NET&lt;/a&gt; to
   production use you'll sooner or later encounter the need for custom build tasks. There's
   only a limited set of them in the package and &lt;a href="http://confluence.public.thoughtworks.org/display/CCNET/Executable+Task"&gt;Executable
   Task&lt;/a&gt; can only do so much. Unfortunately there is not much information available
   on development of custom tasks. Your best sources will be:
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      &lt;a href="http://confluence.public.thoughtworks.org/display/CCNET/Documentation"&gt;Online
      documentation&lt;/a&gt; contains &lt;a href="http://confluence.public.thoughtworks.org/display/CCNET/Custom+Builder+Plug-in"&gt;an
      article on the subject&lt;/a&gt; describing the first steps to get you going. It should
      be your first stop.&lt;/li&gt;
   &lt;li&gt;
      There's &lt;a href="http://blogs.the-collins.net/Josh/archive/2007/04/01/AdventuresInCCNet.aspx"&gt;a
      high level architectural overview&lt;/a&gt; of a simple task available at Josh's Blog.&lt;/li&gt;
   &lt;li&gt;
      Lutz Roeder's &lt;a href="http://www.aisto.com/roeder/dotnet/"&gt;Reflector for .NET&lt;/a&gt; will
      be your best friend. The source of the tasks in ThoughtWorks.CruiseControl.Core will
      soon become your best resource.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
   Apart from that I feel obliged to mention a few of the most important points I've
   come across during the development of a few custom tasks:
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      ThoughtWorks.CruiseControl.Core.Util.ProcessExecutor is a nice little wrapper around
      System.Diagnostics.Process class&amp;nbsp;you'll end up using quite a lot.&lt;/li&gt;
   &lt;li&gt;
      You can add your own information to the build log by calling AddTaskResult on the
      IIntegrationResult instance passed to your ITask.Run method. There are two overloads
      available: one accepting a System.String and another one accepting ITaskResult to
      which you can pass a new FileTaskResult instance to quickly include a complete file.&lt;/li&gt;
   &lt;li&gt;
      If you're doing any checkins to your source control system as a part of the build
      you should call the MarkStartTime method of your IIntegrationResult instance afterwards&amp;nbsp;to
      prevent triggering another build of the same project by setting the last build start
      time after the last checkin time.&lt;/li&gt;
   &lt;li&gt;
      Make sure you use a unique ReflectorType name for your task. The service will just
      silently fail to start in case of a duplicate value.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
   This information should make your first attempts at making&amp;nbsp;your own&amp;nbsp;custom
   task a little easier.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=8e8055e2-dda6-43e2-850b-8a17419a94b2" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,8e8055e2-dda6-43e2-850b-8a17419a94b2.aspx</comments>
      <category>Development;Development/.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=20d7f883-4d11-478a-9d81-b69c38c0c43d</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,20d7f883-4d11-478a-9d81-b69c38c0c43d.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,20d7f883-4d11-478a-9d81-b69c38c0c43d.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=20d7f883-4d11-478a-9d81-b69c38c0c43d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      The 1.3.0.2918 build of <a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET">CruiseControl.NET</a> has
      an error in msbuild.xsl file which causes an XslLoadException to be thrown when trying
      to view the MSBuild output in the web dashboard. One of the users was nice enough
      to <a href="http://groups.google.com.ag/group/ccnet-user/browse_thread/thread/6ca4e259d91399ff#msg_4639bc18e08df384">describe
      the changes</a> to the file necessary to fix the problem. Unfortunately even the latest
      version of the file on the <a href="http://ccnetlive.thoughtworks.com/">CruiseControl.NET
      Live</a> site doesn't include the changes therefore I'm attaching the file to this
      post as convenience.
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=20d7f883-4d11-478a-9d81-b69c38c0c43d" />
      </body>
      <title>MSBuild.xsl problem in CruiseControl.NET 1.3</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,20d7f883-4d11-478a-9d81-b69c38c0c43d.aspx</guid>
      <link>http://www.damirscorner.com/MSBuildxslProblemInCruiseControlNET13.aspx</link>
      <pubDate>Sun, 22 Jul 2007 11:24:07 GMT</pubDate>
      <description>&lt;p&gt;
   The 1.3.0.2918 build of &lt;a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET"&gt;CruiseControl.NET&lt;/a&gt; has
   an error in msbuild.xsl file which causes an XslLoadException to be thrown when trying
   to view the MSBuild output in the web dashboard. One of the users was nice enough
   to &lt;a href="http://groups.google.com.ag/group/ccnet-user/browse_thread/thread/6ca4e259d91399ff#msg_4639bc18e08df384"&gt;describe
   the changes&lt;/a&gt; to the file necessary to fix the problem. Unfortunately even the latest
   version of the file&amp;nbsp;on the &lt;a href="http://ccnetlive.thoughtworks.com/"&gt;CruiseControl.NET
   Live&lt;/a&gt; site doesn't include the changes therefore I'm attaching the file to this
   post as convenience.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=20d7f883-4d11-478a-9d81-b69c38c0c43d" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,20d7f883-4d11-478a-9d81-b69c38c0c43d.aspx</comments>
      <category>Development;Development/.NET;Downloads;Downloads/Sources</category>
      <enclosure url="http://www.damirscorner.com/content/binary/20d7f883-4d11-478a-9d81-b69c38c0c43d/msbuild.zip" type="application/x-zip-compressed" length="1360" />
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=f888abb8-c481-41f5-8b91-aaa7957eb535</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,f888abb8-c481-41f5-8b91-aaa7957eb535.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,f888abb8-c481-41f5-8b91-aaa7957eb535.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=f888abb8-c481-41f5-8b91-aaa7957eb535</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Although a MSI file can bi installed by double clicking on it in Explorer or by selecting
      install from the context menu, you might want to start from command line to include
      it in a script. This can be done by using the msiexec.exe utility. Although it's parameters
      are <a href="http://technet2.microsoft.com/windowsserver/en/library/9361d377-9011-4e21-8011-db371fa220ba1033.mspx?mfr=true">well</a><a href="http://helpnet.installshield.com/robo/projects/HelpLibDevStudio9/IHelpCmdLineMSI.htm">documented</a> I
      had to do some searching to find a way for setting a different installation directory
      than the default one in case the configuration forms are skipped with the /qb option.
      It can be done by setting the INSTALLDIR property to the desired value.
   </p>
        <p>
      As a future reference the following command line triggers the setup package to install
      into the specified directory without opening any additional configuration windows:
   </p>
        <div class="CodeFormatContainer">
          <pre class="csharpcode">msiexec /i MyMSI.msi /qb INSTALLDIR=<span class="str">"C:\Program
      Files\My Install Dir"</span></pre>
        </div>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=f888abb8-c481-41f5-8b91-aaa7957eb535" />
      </body>
      <title>Installing MSI packages from command line</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,f888abb8-c481-41f5-8b91-aaa7957eb535.aspx</guid>
      <link>http://www.damirscorner.com/InstallingMSIPackagesFromCommandLine.aspx</link>
      <pubDate>Sun, 22 Jul 2007 10:24:14 GMT</pubDate>
      <description>&lt;p&gt;
   Although a MSI file can bi installed by double clicking on it in Explorer or by selecting
   install from the context menu, you might want to start from command line to include
   it in a script. This can be done by using the msiexec.exe utility. Although it's parameters
   are &lt;a href="http://technet2.microsoft.com/windowsserver/en/library/9361d377-9011-4e21-8011-db371fa220ba1033.mspx?mfr=true"&gt;well&lt;/a&gt; &lt;a href="http://helpnet.installshield.com/robo/projects/HelpLibDevStudio9/IHelpCmdLineMSI.htm"&gt;documented&lt;/a&gt; I
   had to do some searching to find a way for setting a different installation directory
   than the default one in case the configuration forms are skipped with the /qb option.
   It can be done by setting the INSTALLDIR property to the desired value.
&lt;/p&gt;
&lt;p&gt;
   As a future reference the following command line triggers the setup package to install
   into the specified directory without opening any additional configuration windows:
&lt;/p&gt;
&lt;div class="CodeFormatContainer"&gt;&lt;pre class="csharpcode"&gt;msiexec /i MyMSI.msi /qb INSTALLDIR=&lt;span class="str"&gt;"C:\Program
   Files\My Install Dir"&lt;/span&gt; &lt;/pre&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=f888abb8-c481-41f5-8b91-aaa7957eb535" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,f888abb8-c481-41f5-8b91-aaa7957eb535.aspx</comments>
      <category>Personal;Personal/Software</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=ead407af-dbbb-4cbc-b826-b1934900aef8</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,ead407af-dbbb-4cbc-b826-b1934900aef8.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,ead407af-dbbb-4cbc-b826-b1934900aef8.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ead407af-dbbb-4cbc-b826-b1934900aef8</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      If you need cheap and simple OCR functionality <a href="http://msdn2.microsoft.com/en-us/library/aa203311(office.11).aspx">Microsoft
      Office Document Imaging Type Library</a> (MODI) is a nice option if its requirements
      (Microsoft Office 2003 or later) and limitations (limited language support) don't
      bother you. Here is a simple C# function that does OCR on the image with the specified
      path:
   </p>
        <div class="CodeFormatContainer">
          <pre class="csharpcode">
            <span class="kwrd">static</span>
            <span class="kwrd">string</span> OCR(<span class="kwrd">string</span> path)
      { MODI.Document doc = <span class="kwrd">new</span> MODI.Document(); doc.Create(path);
      doc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, <span class="kwrd">false</span>, <span class="kwrd">false</span>); <span class="kwrd">string</span> result
      = ((MODI.Image)doc.Images[0]).Layout.Text; System.Runtime.InteropServices.Marshal.ReleaseComObject(doc); <span class="kwrd">return</span> result;
      } </pre>
        </div>
        <p>
      However, there is another Microsoft Office object model related problem. For Office
      2003 users to be able to use your application, the MODI 11.0 (2003 version) must be
      referenced in the project and the release version of the application must be compiled
      on a machine with Office 2003 installed. In such a case VB6 still managed to compile
      the project on a machine with a newer version of Office installed, since the newer
      version of the type library was automatically used (MODI 12.0 for Office 2007 in this
      case). On the other hand strong type checking at compile time prevents that in C#.
   </p>
        <p>
      If you want to keep using Office 2007 and be able to compile such a project, the only
      solution is to install Microsoft Office Document Imaging as the only component of
      Office 2003 along the existing Office 2007 installation. Unfortunately this overwrites
      the Microsoft Office Document Image Writer printer driver from 2007 with the older
      version, therefore you'll have to start a lengthy process of repairing the Office
      2007 installation afterwards. And don't forget to apply all the service packs and
      updates for Office 2003 before that since this will also overwrite the printer driver
      and you'll have to repair Office 2007 once again. I learned that the hard way.
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=ead407af-dbbb-4cbc-b826-b1934900aef8" />
      </body>
      <title>OCR with Microsoft Office Document Imaging</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,ead407af-dbbb-4cbc-b826-b1934900aef8.aspx</guid>
      <link>http://www.damirscorner.com/OCRWithMicrosoftOfficeDocumentImaging.aspx</link>
      <pubDate>Sat, 02 Jun 2007 08:39:34 GMT</pubDate>
      <description>&lt;p&gt;
   If you need cheap and simple OCR functionality &lt;a href="http://msdn2.microsoft.com/en-us/library/aa203311(office.11).aspx"&gt;Microsoft
   Office Document Imaging Type Library&lt;/a&gt; (MODI) is a nice option if its requirements
   (Microsoft Office 2003 or later) and limitations (limited language support) don't
   bother you. Here is a simple C# function that does OCR on the image with the specified
   path:
&lt;/p&gt;
&lt;div class="CodeFormatContainer"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; OCR(&lt;span class="kwrd"&gt;string&lt;/span&gt; path)
   { MODI.Document doc = &lt;span class="kwrd"&gt;new&lt;/span&gt; MODI.Document(); doc.Create(path);
   doc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, &lt;span class="kwrd"&gt;false&lt;/span&gt;, &lt;span class="kwrd"&gt;false&lt;/span&gt;); &lt;span class="kwrd"&gt;string&lt;/span&gt; result
   = ((MODI.Image)doc.Images[0]).Layout.Text; System.Runtime.InteropServices.Marshal.ReleaseComObject(doc); &lt;span class="kwrd"&gt;return&lt;/span&gt; result;
   } &lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
   However, there is another Microsoft Office object model related problem. For Office
   2003 users to be able to use your application, the MODI 11.0 (2003 version) must be
   referenced in the project and the release version of the application must be compiled
   on a machine with Office 2003 installed. In such a case VB6 still managed to compile
   the project on a machine with a newer version of Office installed, since the newer
   version of the type library was automatically used (MODI 12.0 for Office 2007 in this
   case). On the other hand strong type checking at compile time prevents that in C#.
&lt;/p&gt;
&lt;p&gt;
   If you want to keep using Office 2007 and be able to compile such a project, the only
   solution is to install Microsoft Office Document Imaging as the only component of
   Office 2003 along the existing Office 2007 installation. Unfortunately this overwrites
   the Microsoft Office Document Image Writer printer driver from 2007 with the older
   version, therefore you'll have to start a lengthy process of repairing the Office
   2007 installation afterwards. And don't forget to apply all the service packs and
   updates for Office 2003 before that since this will also overwrite the printer driver
   and you'll have to repair Office 2007 once again. I learned that the hard way.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=ead407af-dbbb-4cbc-b826-b1934900aef8" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,ead407af-dbbb-4cbc-b826-b1934900aef8.aspx</comments>
      <category>Development;Development/.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.damirscorner.com/Trackback.aspx?guid=b56a5678-74e2-49c0-9d66-9a7148000244</trackback:ping>
      <pingback:server>http://www.damirscorner.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.damirscorner.com/PermaLink,guid,b56a5678-74e2-49c0-9d66-9a7148000244.aspx</pingback:target>
      <dc:creator>damir.arh@gmail.com (Damir Arh)</dc:creator>
      <wfw:comment>http://www.damirscorner.com/CommentView,guid,b56a5678-74e2-49c0-9d66-9a7148000244.aspx</wfw:comment>
      <wfw:commentRss>http://www.damirscorner.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b56a5678-74e2-49c0-9d66-9a7148000244</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Windows Vista unlike the previous versions doesn't have an option to enable or disable
      hibernation in the <font face="Courier New">Power Options</font> of the <font face="Courier New">Control
      Panel</font>. Strangely, if you search for <font face="Courier New">hibernation</font> in <font face="Courier New">Control
      Panel</font> the <font face="Courier New">Turn hibernation on or off </font>option
      will be found but it will only open the <font face="Courier New">Edit Plan Settings</font> dialog
      without hibernation available if it is already disabled. Therefore, if you end up
      with disabled hibernation as I did (probably due to the <font face="Courier New">Hibernation
      File Cleaner</font> option of the <font face="Courier New">Disk Cleanup</font> tool)
      the only way to turn it back on is to open a command prompt and run
   </p>
        <p>
          <font face="Courier New">powercfg -H on</font>
        </p>
        <p>
      This will make the hibernation reappear in all the shutdown menus and power button
      combos.
   </p>
        <img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=b56a5678-74e2-49c0-9d66-9a7148000244" />
      </body>
      <title>How to enable hibernation in Windows Vista</title>
      <guid>http://www.damirscorner.com/PermaLink,guid,b56a5678-74e2-49c0-9d66-9a7148000244.aspx</guid>
      <link>http://www.damirscorner.com/HowToEnableHibernationInWindowsVista.aspx</link>
      <pubDate>Mon, 21 May 2007 19:45:17 GMT</pubDate>
      <description>&lt;p&gt;
   Windows Vista unlike the previous versions doesn't have an option to enable or disable
   hibernation in the &lt;font face="Courier New"&gt;Power Options&lt;/font&gt; of the &lt;font face="Courier New"&gt;Control
   Panel&lt;/font&gt;. Strangely, if you search for &lt;font face="Courier New"&gt;hibernation&lt;/font&gt; in &lt;font face="Courier New"&gt;Control
   Panel&lt;/font&gt; the &lt;font face="Courier New"&gt;Turn hibernation on or off &lt;/font&gt;option
   will be found but it will only open the &lt;font face="Courier New"&gt;Edit Plan Settings&lt;/font&gt; dialog
   without hibernation available if it is already disabled. Therefore, if you end up
   with disabled hibernation as I did (probably due to the &lt;font face="Courier New"&gt;Hibernation
   File Cleaner&lt;/font&gt; option of the &lt;font face="Courier New"&gt;Disk Cleanup&lt;/font&gt; tool)
   the only way to turn it back on is to open a command prompt and run
&lt;/p&gt;
&lt;p&gt;
   &lt;font face="Courier New"&gt;powercfg -H on&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
   This will make the hibernation reappear in all the shutdown menus and power button
   combos.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.damirscorner.com/aggbug.ashx?id=b56a5678-74e2-49c0-9d66-9a7148000244" /&gt;</description>
      <comments>http://www.damirscorner.com/CommentView,guid,b56a5678-74e2-49c0-9d66-9a7148000244.aspx</comments>
      <category>Personal/Software</category>
    </item>
  </channel>
</rss>