﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
  <channel>
    <title>Ulrich Strauss: Get Embedded!</title>
    <description>Nintex , SharePoint and Embedded Fun</description>
    <link>http://www.coppercoins.de/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.10</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.coppercoins.de/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.coppercoins.de/syndication.axd</blogChannel:blink>
    <dc:creator>Ulrich Strauss</dc:creator>
    <dc:title>Ulrich Strauss: Get Embedded!</dc:title>
    <geo:lat>481,920.000000</geo:lat>
    <geo:long>116,636.000000</geo:long>
    <item>
      <title>Getting rid off the workflow-status column and prevent manual start</title>
      <description>&lt;p&gt;Who didn’t get annoyed by those workflow status columns popping up in lists when a declarative workflow is installed/instantiated the first time? All of you I assume.&lt;/p&gt;  &lt;p&gt;Usually my answer to customers always was: well either remove it from the view manually/automatically or live with it …&lt;/p&gt;  &lt;p&gt;Quite an unsatisfactory answer, of course.    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;You &lt;strong&gt;can&lt;/strong&gt; configure if a workflow has a status column or not. But guess what… The property (&lt;em&gt;SPWorkflowAssociation.Configuration&lt;/em&gt;) is &lt;em&gt;internal&lt;/em&gt; , sigh again. You can set it when deploying workflows using features, but (usually) not for declarative ones like Nintex or SPD-Workflows.&lt;/p&gt;  &lt;p&gt;Some digging leads to &lt;a href="http://stackoverflow.com/questions/1565734/is-it-possible-to-set-private-property-via-reflection" target="_blank"&gt;this post&lt;/a&gt;. So now the first goal is reached. You can set the property to prevent the workflow-status-column to be added to the default view of the target list:&lt;/p&gt;  &lt;p&gt;Snippet1: Object-Extensions to call internal methods&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; myObjectExtensions&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Returns a _private_ Property Value from a given Object. Uses Reflection.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Throws a ArgumentOutOfRangeException if the Property is not found.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;typeparam name=&amp;quot;T&amp;quot;&amp;gt;Type of the Property&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;obj&amp;quot;&amp;gt;Object from where the Property Value is returned&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;propName&amp;quot;&amp;gt;Propertyname as string.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;returns&amp;gt;PropertyValue&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; T GetPrivatePropertyValue&amp;lt;T&amp;gt;(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; obj, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; propName)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (obj == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color: #006080"&gt;&amp;quot;obj&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         PropertyInfo pi = obj.GetType().GetProperty(propName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (pi == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentOutOfRangeException(&lt;span style="color: #006080"&gt;&amp;quot;propName&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;&amp;quot;Property {0} was not found in Type {1}&amp;quot;&lt;/span&gt;, propName, obj.GetType().FullName));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (T)pi.GetValue(obj, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Returns a private Property Value from a given Object. Uses Reflection.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Throws a ArgumentOutOfRangeException if the Property is not found.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;typeparam name=&amp;quot;T&amp;quot;&amp;gt;Type of the Property&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;obj&amp;quot;&amp;gt;Object from where the Property Value is returned&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;propName&amp;quot;&amp;gt;Propertyname as string.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;returns&amp;gt;PropertyValue&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; T GetPrivateFieldValue&amp;lt;T&amp;gt;(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; obj, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; propName)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (obj == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color: #006080"&gt;&amp;quot;obj&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;         Type t = obj.GetType();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;         FieldInfo fi = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (fi == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; t != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt;             fi = t.GetField(propName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum36"&gt;  36:&lt;/span&gt;             t = t.BaseType;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum37"&gt;  37:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum38"&gt;  38:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (fi == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentOutOfRangeException(&lt;span style="color: #006080"&gt;&amp;quot;propName&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;&amp;quot;Field {0} was not found in Type {1}&amp;quot;&lt;/span&gt;, propName, obj.GetType().FullName));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum39"&gt;  39:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (T)fi.GetValue(obj);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum40"&gt;  40:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum41"&gt;  41:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum42"&gt;  42:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum43"&gt;  43:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Sets a _private_ Property Value from a given Object. Uses Reflection.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum44"&gt;  44:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Throws a ArgumentOutOfRangeException if the Property is not found.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum45"&gt;  45:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum46"&gt;  46:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;typeparam name=&amp;quot;T&amp;quot;&amp;gt;Type of the Property&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum47"&gt;  47:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;obj&amp;quot;&amp;gt;Object from where the Property Value is set&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum48"&gt;  48:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;propName&amp;quot;&amp;gt;Propertyname as string.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum49"&gt;  49:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;val&amp;quot;&amp;gt;Value to set.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum50"&gt;  50:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;returns&amp;gt;PropertyValue&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum51"&gt;  51:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetPrivatePropertyValue&amp;lt;T&amp;gt;(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; obj, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; propName, T val)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum52"&gt;  52:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum53"&gt;  53:&lt;/span&gt;         Type t = obj.GetType();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum54"&gt;  54:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (t.GetProperty(propName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum55"&gt;  55:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentOutOfRangeException(&lt;span style="color: #006080"&gt;&amp;quot;propName&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;&amp;quot;Property {0} was not found in Type {1}&amp;quot;&lt;/span&gt;, propName, obj.GetType().FullName));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum56"&gt;  56:&lt;/span&gt;         t.InvokeMember(propName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.SetProperty | BindingFlags.Instance, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, obj, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;[] { val });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum57"&gt;  57:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum58"&gt;  58:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum59"&gt;  59:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum60"&gt;  60:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Set a private Property Value on a given Object. Uses Reflection.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum61"&gt;  61:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum62"&gt;  62:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;typeparam name=&amp;quot;T&amp;quot;&amp;gt;Type of the Property&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum63"&gt;  63:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;obj&amp;quot;&amp;gt;Object from where the Property Value is returned&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum64"&gt;  64:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;propName&amp;quot;&amp;gt;Propertyname as string.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum65"&gt;  65:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;val&amp;quot;&amp;gt;the value to set&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum66"&gt;  66:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;exception cref=&amp;quot;ArgumentOutOfRangeException&amp;quot;&amp;gt;if the Property is not found&amp;lt;/exception&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum67"&gt;  67:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetPrivateFieldValue&amp;lt;T&amp;gt;(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; obj, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; propName, T val)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum68"&gt;  68:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum69"&gt;  69:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (obj == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color: #006080"&gt;&amp;quot;obj&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum70"&gt;  70:&lt;/span&gt;         Type t = obj.GetType();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum71"&gt;  71:&lt;/span&gt;         FieldInfo fi = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum72"&gt;  72:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (fi == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; t != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum73"&gt;  73:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum74"&gt;  74:&lt;/span&gt;             fi = t.GetField(propName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum75"&gt;  75:&lt;/span&gt;             t = t.BaseType;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum76"&gt;  76:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum77"&gt;  77:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (fi == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentOutOfRangeException(&lt;span style="color: #006080"&gt;&amp;quot;propName&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;&amp;quot;Field {0} was not found in Type {1}&amp;quot;&lt;/span&gt;, propName, obj.GetType().FullName));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum78"&gt;  78:&lt;/span&gt;         fi.SetValue(obj, val);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum79"&gt;  79:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum80"&gt;  80:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Snippet2: Code to apply when publishing declarative Nintex Workflows&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; SPWorkflowAssociationCollection.Configuration cfg = assoc.GetPrivatePropertyValue&amp;lt;SPWorkflowAssociationCollection.Configuration&amp;gt;( &lt;span style="color: #006080"&gt;&amp;quot;Configuration&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #008000"&gt;// This will prevent adding of the status coloum to the default view&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; cfg &amp;amp;= ~SPWorkflowAssociationCollection.Configuration.HasStatusColumn;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; assoc.SetPrivatePropertyValue&amp;lt;SPWorkflowAssociationCollection.Configuration&amp;gt;( &lt;span style="color: #006080"&gt;&amp;quot;Configuration&amp;quot;&lt;/span&gt;, cfg);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now we are almost there. The next thing is, you cannot completely hide those workflows from the user. Because you either have to choose either manual start or automatic start (change/create). No way to publish it without it (if you do not check any startup-choice, Nintex will tag it as “Manual start” for you).&lt;/p&gt;

&lt;p&gt;Since in my case all workflows are started by either other workflows or webservices goal #2 is to hide those workflows from end-users. Well this part is easy, since I am modifying the SPWorkflowAssociation anyway, I can set the permissions needed to be able to start the workflow manually as well. I decided to require ManagePermissions-Rights to be able to start (and see it in the workflows-start page) the workflow manually. &lt;/p&gt;

&lt;p&gt;Snippet3: Hide the Workflow from end-user&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; assoc.PermissionsManual |= SPBasePermissions.ManagePermissions;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Putting it all together it looks like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; SPWorkflowAssociation assoc = targetList.WorkflowAssociations.GetAssociationByName(workflowName, CultureInfo.InvariantCulture);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (assoc != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// If name starts with &amp;quot;int&amp;quot; Hide it from the start workflow page for normal users and require ManagePermissions-Right to see it&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (workflowName.StartsWith(&lt;span style="color: #006080"&gt;&amp;quot;int&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         assoc.PermissionsManual |= SPBasePermissions.ManagePermissions;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;                        &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     SPWorkflowAssociationCollection.Configuration cfg = assoc.GetPrivatePropertyValue&amp;lt;SPWorkflowAssociationCollection.Configuration&amp;gt;( &lt;span style="color: #006080"&gt;&amp;quot;Configuration&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// This will prevent adding of the status coloum to the default view&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     cfg &amp;amp;= ~SPWorkflowAssociationCollection.Configuration.HasStatusColumn;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     assoc.SetPrivatePropertyValue&amp;lt;SPWorkflowAssociationCollection.Configuration&amp;gt;( &lt;span style="color: #006080"&gt;&amp;quot;Configuration&amp;quot;&lt;/span&gt;, cfg);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;     targetList.UpdateWorkflowAssociation(assoc);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;     targetList.Update();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Only thing to keep in mind is, that if you update the workflow (e.g. republish it) you will need to reapply that patch, else the status-column will appear in the default view when the workflow starts the first time.&lt;/p&gt;</description>
      <link>http://www.coppercoins.de/post/2010/02/02/Getting-rid-off-the-workflow-status-column-and-prevent-manual-start.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2010/02/02/Getting-rid-off-the-workflow-status-column-and-prevent-manual-start.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=627e72e0-c30a-442e-b816-1ee834b0903e</guid>
      <pubDate>Tue, 02 Feb 2010 23:08:27 +0200</pubDate>
      <category>SharePoint 2007</category>
      <category>Nintex</category>
      <category>MOSS</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=627e72e0-c30a-442e-b816-1ee834b0903e</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=627e72e0-c30a-442e-b816-1ee834b0903e</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2010/02/02/Getting-rid-off-the-workflow-status-column-and-prevent-manual-start.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=627e72e0-c30a-442e-b816-1ee834b0903e</wfw:commentRss>
    </item>
    <item>
      <title>SimRacing: Announcing RacerTool-Suite for RACE07/GTR2</title>
      <description>&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
I&amp;#39;m&amp;nbsp;an enthusiastic Sim-Racer and started to write some tools for analyzing replay&amp;#39;s of SimBin-Simulations (GTR2 , RACE07, GTR Evolution) and post-analyze telemetry data.&lt;br /&gt;
In the following weeks I will&amp;nbsp;introduce&amp;nbsp;the RacerTool-Suite to public which includes (but is not limited to) &amp;quot;VCR Refocus&amp;quot; ,&amp;quot;VCR Analyze&amp;quot;,&amp;quot;VCR AutoProcess&amp;quot; and will also give some insight about the nature of the replays, mathematics behind and how to get hold of some of the &amp;quot;secret&amp;quot;&amp;nbsp;telemetry data. 
&lt;/p&gt;
&lt;p&gt;
Currently some of the tools are in beta-testing. If you like to join in, leave me a message. All you need is RACE07/GTR Evolution and&amp;nbsp;some spare time. 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;a href="http://www.coppercoins.de/image.axd?picture=2009%2f2%2fvcranalyzer-1.jpg" target="_blank" search="?picture=2009%2f2%2fvcranalyzer-1.jpg"&gt;&lt;img src="http://www.coppercoins.de/image.axd?picture=2009%2f2%2fvcranalyzer-1.jpg" alt="" width="300" height="200" /&gt; &lt;/a&gt;
</description>
      <link>http://www.coppercoins.de/post/2009/02/24/SimRacing-Announcing-RacerTool-Suite-for-RACE07GTR2.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2009/02/24/SimRacing-Announcing-RacerTool-Suite-for-RACE07GTR2.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=a42e1cb5-a032-4791-83b7-fc0168efbf38</guid>
      <pubDate>Tue, 24 Feb 2009 22:40:00 +0200</pubDate>
      <category>SimRacing</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=a42e1cb5-a032-4791-83b7-fc0168efbf38</pingback:target>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=a42e1cb5-a032-4791-83b7-fc0168efbf38</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2009/02/24/SimRacing-Announcing-RacerTool-Suite-for-RACE07GTR2.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=a42e1cb5-a032-4791-83b7-fc0168efbf38</wfw:commentRss>
    </item>
    <item>
      <title>Short Update</title>
      <description>&lt;p&gt;It has been quite some time since the last post, so here is a short update.&lt;/p&gt;  &lt;p&gt;Since I’m currently in the progress of looking for a new job, I don’t have a lot of time to push the &lt;a href="http://www.coppercoins.de/category/Embedded-Media-Framework.aspx" target="_blank"&gt;Embedded Media Framework&lt;/a&gt;. Real life is more important, but the basic outline is done, and the basic implementation is done also. I hopefully find some time to upload the sources to Codeplex the next days.&lt;/p&gt;  &lt;p&gt;If you are looking for an Embedded/Net CF/IPTV/Multimedia expert get in touch with me…&lt;/p&gt;</description>
      <link>http://www.coppercoins.de/post/2009/01/29/Short-Update.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2009/01/29/Short-Update.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=3089fc12-4d9c-4526-a191-3f107bed4ac1</guid>
      <pubDate>Thu, 29 Jan 2009 12:26:18 +0200</pubDate>
      <category>General</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=3089fc12-4d9c-4526-a191-3f107bed4ac1</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=3089fc12-4d9c-4526-a191-3f107bed4ac1</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2009/01/29/Short-Update.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=3089fc12-4d9c-4526-a191-3f107bed4ac1</wfw:commentRss>
    </item>
    <item>
      <title>EMF: An extended PictureBox with alpha blending and transparency</title>
      <description>&lt;p&gt;When working with PictureBox using .NET Compact Framework, you will notice that it does not support transparent Bitmaps.&lt;/p&gt;  &lt;p&gt;So if you need transparent picture boxes or alpha blending here’s what you need:&lt;/p&gt;  &lt;div class="CodeFormatContainer"&gt;   &lt;div class="csharpcode"&gt;     &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; EMF.Forms.Controls&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; PictureBoxEx : PictureBox, ISupportInitialize&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; PictureBoxEx();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt; AlphablendFactor { get; set; }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Color TransparentColor { get; set; }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Dispose(&lt;span class="kwrd"&gt;bool&lt;/span&gt; disposing);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; MakeTransparent();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; MakeTransparent(&lt;span class="kwrd"&gt;int&lt;/span&gt; x, &lt;span class="kwrd"&gt;int&lt;/span&gt; y);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnPaint(PaintEventArgs e);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnPaintBackground(PaintEventArgs e);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Since EMF is not yet published to public you can download the code here: &lt;a href="http://www.coppercoins.de/downloads/EMF_PictureBoxEx.zip" target="_blank" rel="nofollow"&gt;EMF_PictureBoxEx.zip&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.coppercoins.de/post/2008/11/12/EMF-An-extended-PictureBox-with-alpha-blending-and-transparency.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/11/12/EMF-An-extended-PictureBox-with-alpha-blending-and-transparency.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=2649f5e4-e163-4436-a8f6-6f8a0d778c4f</guid>
      <pubDate>Wed, 12 Nov 2008 14:58:34 +0200</pubDate>
      <category>.NETCF</category>
      <category>Embedded Media Framework</category>
      <category>Controls</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=2649f5e4-e163-4436-a8f6-6f8a0d778c4f</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=2649f5e4-e163-4436-a8f6-6f8a0d778c4f</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/11/12/EMF-An-extended-PictureBox-with-alpha-blending-and-transparency.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=2649f5e4-e163-4436-a8f6-6f8a0d778c4f</wfw:commentRss>
    </item>
    <item>
      <title>WMP Part V: Implementing a Mediaplayer using DirectShow.NET</title>
      <description>&lt;p&gt;I got quite some requests for a demo of doing all the previous stuff purely in .NET Compact Framework without using native code. So I dug for some of my old presentation slides and samples from 2007.&lt;/p&gt;  &lt;p&gt;The goal is to implement a sample like in &lt;a href="http://www.coppercoins.de/post.aspx?id=5d2636f6-eb75-490e-a75d-8fab051f380c" target="_blank"&gt;Part IV&lt;/a&gt; without using any native code. As as you will see, this is not complicated as well. However this is a “quick hack” without any guarantees or warranties.&lt;/p&gt;  &lt;h3&gt;DirectShow .NET&lt;/h3&gt;  &lt;p&gt;The starting point is the &lt;a href="http://directshownet.sourceforge.net/index.html" target="_blank"&gt;DirectShowNet Library&lt;/a&gt;. Download it and open the solution is Visual Studio.NET. Now add a new SmartDevice Class Library Project to the Solution and add all source files from DirectShowLib to it.&lt;/p&gt;  &lt;p&gt;If you hit compile, you will receive, as expected, a whole bunch of errors. Never say die!. It’s not really hard stuff.    &lt;br /&gt;There are mainly 2 types of Errors: Unsupported base classes (like ICustomMarshaler) and unsupported parameter classes/Attributes. &lt;/p&gt;  &lt;p&gt;You have 2 main options now:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Try to find the missing base classes on the net, or implementing them yourself &lt;/li&gt;    &lt;li&gt;Check if you really need those classes. If not simply remove them! &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Well, since Windows Embedded CE only supports a subset of DirectShow anyway, I chose option 2. &lt;/p&gt;  &lt;p&gt;Browse through the errors and whenever it’s a base class problem, decide if the class is needed. If not, remove the class or the entire file.    &lt;br /&gt;If it’s an attribute problem, it will be “System.Security.SuppressUnmanagedCodeSecurity” is not supported by .Net Compact Framework. Either remove the Attribute or Implement it as a dummy. (I removed it).     &lt;br /&gt;In case of a parameter problem like &lt;/p&gt;  &lt;div class="CodeFormatContainer"&gt;   &lt;pre class="csharpcode"&gt;            [In] IMoniker pMoniker,
            [In] IBindCtx pCtx,&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;I checked if the methods are needed, and decided to comment the whole method in most of the cases.&lt;/p&gt;

&lt;p&gt;If I remember correctly, it took me about 8 hours to go through all the code, lookup the purpose at MSDN and browsing for possible .NET Compact Framework workarounds. (But since I’m a nice guy, you can download my modified version :-) )
  &lt;br /&gt;Since my modified code is not based on the latest available release of DirectShowLib, there might be additional things you might need to change since that time. Also note, that not all the interfaces/modifications have been fully tested.&lt;/p&gt;

&lt;h3&gt;Sample Application&lt;/h3&gt;

&lt;p&gt;To demonstrate the usage, I simply took one of the DirectShowLib samples (PlayWnd) , and removed the menustuff (since my device does not have a keyboard/mouse). 
  &lt;br /&gt;Only a few modifications are needed here. 

  &lt;br /&gt;The biggest one is .Net Compact Framework Form-Class does not support to override the WndProc to process messages from the Filtergraph. But luckily we have the MessageWindow-Class which will help us:&lt;/p&gt;

&lt;div class="CodeFormatContainer"&gt;
  &lt;div class="csharpcode"&gt;
    &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; DirectShowLib.Sample;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.WindowsCE.Forms;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; DirectShowLib.Sample&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;{&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd"&gt;class&lt;/span&gt; CEMessage : MessageWindow&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; MainForm myForm;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; CEMessage(MainForm mainForm)&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            myForm = mainForm;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WndProc(&lt;span class="kwrd"&gt;ref&lt;/span&gt; Message m)&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;            myForm.myWndProc(&lt;span class="kwrd"&gt;ref&lt;/span&gt; m);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;            &lt;span class="kwrd"&gt;base&lt;/span&gt;.WndProc(&lt;span class="kwrd"&gt;ref&lt;/span&gt; m);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Then you just have to try/catch around some method calls/typecasts which will most likely throw an exception in Windows Embedded CE.&lt;/p&gt;

&lt;p&gt;And then you are done. &lt;/p&gt;

&lt;h3&gt;Summary&lt;/h3&gt;

&lt;p&gt;We have created a simple .NET Compact Framework Mediaplayer-Application without using any native code based on the &lt;a href="http://directshownet.sourceforge.net/index.html" target="_blank"&gt;DirectShowNet Library&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You can download my modified DirectShowLib and the sample application (tested on Windows Embedded CE 6 R2)here: &lt;a href="http://www.coppercoins.de/downloads/DirectShowNETCF_Sample.zip" target="_blank" rel="nofollow"&gt;DirectShowNETCF_Sample.zip&lt;/a&gt;

  &lt;br /&gt;(Since the my modified version of DirectShowLib is quite old already, it’s not based on the latest available version.)&lt;/p&gt;

&lt;p&gt;As always, this is just a demonstration, to really use it you will have to craft your own application or wait for the first release of the &lt;a href="http://www.coppercoins.de/category/Embedded-Media-Framework.aspx" target="_blank"&gt;Embedded Media Framework&lt;/a&gt;. &lt;/p&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:3710898a-d136-46d6-8c59-cf33773985f5" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/windows+ce" rel="tag"&gt;windows ce&lt;/a&gt;,&lt;a href="http://technorati.com/tags/windows+embedded" rel="tag"&gt;windows embedded&lt;/a&gt;,&lt;a href="http://technorati.com/tags/mediaplayer" rel="tag"&gt;mediaplayer&lt;/a&gt;,&lt;a href="http://technorati.com/tags/.NET+Compact+Framework" rel="tag"&gt;.NET Compact Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/directshow" rel="tag"&gt;directshow&lt;/a&gt;&lt;/div&gt;</description>
      <link>http://www.coppercoins.de/post/2008/11/10/WMP-Part-V-Implementing-a-Mediaplayer-using-DirectShowNET.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/11/10/WMP-Part-V-Implementing-a-Mediaplayer-using-DirectShowNET.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=2e8dbe00-f13b-452f-919c-18cdc7e1a751</guid>
      <pubDate>Mon, 10 Nov 2008 15:18:16 +0200</pubDate>
      <category>.NETCF</category>
      <category>DirectShow</category>
      <category>Mediaplayer</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=2e8dbe00-f13b-452f-919c-18cdc7e1a751</pingback:target>
      <slash:comments>21</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=2e8dbe00-f13b-452f-919c-18cdc7e1a751</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/11/10/WMP-Part-V-Implementing-a-Mediaplayer-using-DirectShowNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=2e8dbe00-f13b-452f-919c-18cdc7e1a751</wfw:commentRss>
    </item>
    <item>
      <title>WMP Part IV: Implementing a Mediaplayer using DirectShow</title>
      <description>&lt;p&gt;Implementing a Mediaplayer using the DirectShow-Interfaces is not as complicated as you might think. All you need is some very basic knowledge about DirectShow, which you can easily learn from &lt;a href="http://msdn.microsoft.com/en-us/library/ms783787(VS.85).aspx" target="_blank"&gt;MSDN&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;All you need to get started is a Windows Embedded CE SDK for your Device. Of course you should have enabled DirectShow in the Platform Builder and ATL-Support comes in handy as well.&lt;/p&gt;  &lt;p&gt;DirectShow is, as you might know, native, so how to glue this together with a .NET Compact Framework UI? Well that’s pretty easy. If you export some functions from your native code to get things rolling, you can call them via a P/Invoke from your .NET Compact Framework application. &lt;/p&gt;  &lt;p&gt;To get started, created a new Solution and add 3 Projects to it:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;WMPDShow.Native : A Visual C++ Smartdevice DLL with ATL support. NO MFC!&lt;/li&gt;    &lt;li&gt;WMPDShow.Interop: A C# Smartdevice Class Libary (this will be our interface to the Native code)&lt;/li&gt;    &lt;li&gt;WMPDShow: A C# Smartdevice Forms Application&lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;TIP 1&lt;/h3&gt;  &lt;p&gt;To prevent linker problems later on, be sure to set “Treat wchar_t as Built-In Type” to &lt;strong&gt;NO&lt;/strong&gt; in all configurations of WMPDShow.Native.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.coppercoins.de/image.axd?picture=WindowsLiveWriter/WMPPartIVImplementingaMediaplayerusingDi_F7C6/wchart_2.jpg"&gt;&lt;img title="wchart" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="154" alt="wchart" src="http://www.coppercoins.de/image.axd?picture=WindowsLiveWriter/WMPPartIVImplementingaMediaplayerusingDi_F7C6/wchart_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;Step 1: Simply Playback&lt;/h3&gt;  &lt;p&gt;To playback a video using DirectShow, the native code (namely the renderer) needs to know where to display the video. So we add a Panel-Control to our form. The Panel is the placeholder for the video.&lt;/p&gt;  &lt;p&gt;The WMPDShow.Native now gets an exported Function which will care for creating the graph and playing it actually:&lt;/p&gt;  &lt;div class="CodeFormatContainer"&gt;   &lt;div class="csharpcode"&gt;     &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;WMPDSHOWNATIVE_API BOOL PlayURL(LPCTSTR szURL, HWND hVideoWindow)&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;   IGraphBuilder *pGraph = NULL;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;   IMediaControl *pControl = NULL;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;   IMediaEvent   *pEvent = NULL;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;   IVideoWindow  *pVideoWindow = NULL;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;   BOOL        bRetVal = FALSE;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;   &lt;span class="rem"&gt;// Initialize the COM library.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;   HRESULT hr = CoInitializeEx(NULL,COINIT_MULTITHREADED);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;   &lt;span class="kwrd"&gt;if&lt;/span&gt; (FAILED(hr))&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;   {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;      DEBUGMSG(1,(_T(&lt;span class="str"&gt;&amp;quot;ERROR - Could not initialize COM library\r\n&amp;quot;&lt;/span&gt;)));&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;      &lt;span class="kwrd"&gt;return&lt;/span&gt; bRetVal;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;   }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;   &lt;span class="rem"&gt;// Create the filter graph manager and query for interfaces.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;   hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;      IID_IGraphBuilder, (&lt;span class="kwrd"&gt;void&lt;/span&gt; **)&amp;amp;pGraph);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;   &lt;span class="kwrd"&gt;if&lt;/span&gt; (FAILED(hr))&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;   {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;      DEBUGMSG(1,(_T(&lt;span class="str"&gt;&amp;quot;ERROR - Could not create the Filter Graph Manager.\r\n&amp;quot;&lt;/span&gt;)));&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;      &lt;span class="kwrd"&gt;return&lt;/span&gt; bRetVal;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;   }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;   hr = pGraph-&amp;gt;QueryInterface(IID_IMediaControl, (&lt;span class="kwrd"&gt;void&lt;/span&gt; **)&amp;amp;pControl);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;   hr = pGraph-&amp;gt;QueryInterface(IID_IMediaEvent, (&lt;span class="kwrd"&gt;void&lt;/span&gt; **)&amp;amp;pEvent);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;   hr = pGraph-&amp;gt;QueryInterface(IID_IVideoWindow, (&lt;span class="kwrd"&gt;void&lt;/span&gt; **)&amp;amp;pVideoWindow);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;   &lt;span class="rem"&gt;// Build the graph. IMPORTANT: Change this string to a file on your system.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;   hr = pGraph-&amp;gt;RenderFile(szURL, NULL);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;   &lt;span class="kwrd"&gt;if&lt;/span&gt; (SUCCEEDED(hr))&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;   {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;      &lt;span class="rem"&gt;// Setup the Videowindow&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt; (hVideoWindow != NULL)&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;      {         &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;         pVideoWindow-&amp;gt;put_Owner((OAHWND)hVideoWindow);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;         pVideoWindow-&amp;gt;put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;         RECT rect;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;         GetClientRect(hVideoWindow, &amp;amp;rect);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;         pVideoWindow-&amp;gt;SetWindowPosition(0, 0, rect.right, rect.bottom);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;      }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;      &lt;span class="rem"&gt;// Run the graph.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;      hr = pControl-&amp;gt;Run();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt; (SUCCEEDED(hr))&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;      {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  49:  &lt;/span&gt;         bRetVal = TRUE;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  50:  &lt;/span&gt;         &lt;span class="rem"&gt;// Wait for completion.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  51:  &lt;/span&gt;         &lt;span class="kwrd"&gt;long&lt;/span&gt; evCode;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  52:  &lt;/span&gt;         pEvent-&amp;gt;WaitForCompletion(INFINITE, &amp;amp;evCode);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  53:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  54:  &lt;/span&gt;         &lt;span class="rem"&gt;// Note: Do not use INFINITE in a real application, because it&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  55:  &lt;/span&gt;         &lt;span class="rem"&gt;// can block indefinitely.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  56:  &lt;/span&gt;      }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  57:  &lt;/span&gt;   } &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  58:  &lt;/span&gt;   &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  59:  &lt;/span&gt;   {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  60:  &lt;/span&gt;      DEBUGMSG(1,(_T(&lt;span class="str"&gt;&amp;quot;Renderfile failed with %08x\r\n&amp;quot;&lt;/span&gt;),hr));&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  61:  &lt;/span&gt;   }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  62:  &lt;/span&gt;   pVideoWindow-&amp;gt;Release();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  63:  &lt;/span&gt;   pControl-&amp;gt;Release();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  64:  &lt;/span&gt;   pEvent-&amp;gt;Release();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  65:  &lt;/span&gt;   pGraph-&amp;gt;Release();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  66:  &lt;/span&gt;   CoUninitialize();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  67:  &lt;/span&gt;   &lt;span class="kwrd"&gt;return&lt;/span&gt; bRetVal;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  68:  &lt;/span&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class="CodeFormatContainer"&gt;
  &lt;div class="csharpcode"&gt;
    &lt;pre&gt;&lt;span class="lnum"&gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;and WMPDshow.Interop will receive the P/Invoke definition:&lt;/p&gt;

&lt;div class="CodeFormatContainer"&gt;
  &lt;div class="csharpcode"&gt;
    &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; NativeMethods&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        [DllImportAttribute(&lt;span class="str"&gt;&amp;quot;WMPDShow.Native.dll&amp;quot;&lt;/span&gt;, EntryPoint = &lt;span class="str"&gt;&amp;quot;PlayURL&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        [&lt;span class="kwrd"&gt;return&lt;/span&gt;: MarshalAsAttribute(UnmanagedType.Bool)]&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;extern&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; PlayURL( &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; szURL, &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            System.IntPtr hVideoWindow&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            );&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;span class="lnum"&gt;&amp;#160;&amp;#160; finally the form will get a call to PlayURL:&lt;/span&gt;&lt;/p&gt;

&lt;div class="CodeFormatContainer"&gt;
  &lt;div class="csharpcode"&gt;
    &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Form1 : Form&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Form1()&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            InitializeComponent();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; timer1_Tick(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            timer1.Enabled = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            WMPDShow.Interop.NativeMethods.PlayURL(&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                &lt;span class="str"&gt;&amp;quot;http://www.coppercoins.de/Downloads/Demo.wmv&amp;quot;&lt;/span&gt;, &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;                &lt;span class="kwrd"&gt;this&lt;/span&gt;.panel1.Handle&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                );&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;As you can see the call to PlayURL is made via a Timer. Because of the current layout of the Project the call to PlayURL will block the Application. So if you call PlayURL in the Load-Event you will hear audio but see no video because the Form is not visible yet.&lt;/p&gt;

&lt;p&gt;Summary&lt;/p&gt;

&lt;p&gt;We have created an application to playback via DirectShow with almost no afford. And as you can see it’s really not heavy stuff. &lt;/p&gt;

&lt;p&gt;So the next steps will be:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Re-Design to prevent blocking of the Application&lt;/li&gt;

  &lt;li&gt;Pass Information from DirectShow asynchronously back to the Application&lt;/li&gt;

  &lt;li&gt;Control the Playback from within the Application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can download the code here: &lt;a href="http://www.coppercoins.de/downloads/WMPDShow_Step1.zip" target="_blank"&gt;WMPDShow_Step1.zip&lt;/a&gt;.&lt;/p&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:42043c85-f2b7-43b7-96ca-9644d218f686" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/windows+ce" rel="tag"&gt;windows ce&lt;/a&gt;,&lt;a href="http://technorati.com/tags/windows+embedded" rel="tag"&gt;windows embedded&lt;/a&gt;,&lt;a href="http://technorati.com/tags/mediaplayer" rel="tag"&gt;mediaplayer&lt;/a&gt;,&lt;a href="http://technorati.com/tags/.NET+Compact+Framework" rel="tag"&gt;.NET Compact Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/directshow" rel="tag"&gt;directshow&lt;/a&gt;&lt;/div&gt;</description>
      <link>http://www.coppercoins.de/post/2008/11/06/WMP-Part-IV-Implementing-a-Mediaplayer-using-DirectShow.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/11/06/WMP-Part-IV-Implementing-a-Mediaplayer-using-DirectShow.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=5d2636f6-eb75-490e-a75d-8fab051f380c</guid>
      <pubDate>Thu, 06 Nov 2008 17:37:25 +0200</pubDate>
      <category>.NETCF</category>
      <category>DirectShow</category>
      <category>Mediaplayer</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=5d2636f6-eb75-490e-a75d-8fab051f380c</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=5d2636f6-eb75-490e-a75d-8fab051f380c</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/11/06/WMP-Part-IV-Implementing-a-Mediaplayer-using-DirectShow.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=5d2636f6-eb75-490e-a75d-8fab051f380c</wfw:commentRss>
    </item>
    <item>
      <title>Embedded Media Framework: Getting started or Ingredients needed</title>
      <description>&lt;p&gt;After getting familiar with the &lt;a href="http://www.coppercoins.de/category/ActiveX.aspx"&gt;AxHost&lt;/a&gt; stuff you will notice some drawbacks. Well after all ActiveX-hosting is not officially supported by Windows Embedded CE, so you should just be glad it somehow works at all.&lt;/p&gt;  &lt;p&gt;So the next step, to leverage your Application, would be to replace the Windows Mediaplayer ActiveX by an all new reusable, reliable and stable media component which does not use the AxHost stuff, will allow to alter some of the default behavior of the Mediaplayer and has a 100% .NET CF UI.&lt;/p&gt;  &lt;h3&gt;How to achieve this?&lt;/h3&gt;  &lt;p&gt;Well there are several ways to do this.    &lt;br /&gt;The most obvious is of course to take the ceplayer source and base your application on it. But hey, I want to do .NET so this one drops out.&lt;/p&gt;  &lt;p&gt;Ok, so think about a possible way to combine multimedia with .NET, without using ActiveX.    &lt;br /&gt;The solution is pretty simply: DirectShow.&lt;/p&gt;  &lt;p&gt;Hmm DirectShow.. But isn’t this native code?    &lt;br /&gt;Yes it is, but since I will not use any device dependent stuff, this is not that important. Once you have the native component compiled for a CPU, you can reuse it, as long as the target device has the necessary items in the image. The next step then will be to use DirectShow directly from managed code, but I still hope that someday Microsoft will do this! Also &lt;a href="http://www.opennetcf.com/Products/Controls/MediaPlayerControls/tabid/264/Default.aspx" target="_blank"&gt;OpenNETCF&lt;/a&gt; has done this already. Other good starting points are &lt;a title="http://windowsmedianet.sourceforge.net/index.html" href="http://windowsmedianet.sourceforge.net/index.html" target="_blank"&gt;WindowsMedia.NET&lt;/a&gt; , &lt;a title="http://tmhare.mvps.org/" href="http://tmhare.mvps.org/" target="_blank"&gt;The March Hare&lt;/a&gt; , &lt;a title="Home" href="http://directshownet.sourceforge.net/index.html" target="_blank"&gt;directshow.net&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Pros and Cons&lt;/h3&gt;  &lt;p&gt;Implementing a “new” Mediaplayer using DirectShow of course requires some work and you will have to care for stuff the Mediaplayer usually does for you. But once you are satisfied, you will have a monster media component where you actually know what happens, can lookup the source as needed.&lt;/p&gt;  &lt;p&gt;Why reinventing the wheel, you might ask. There are a lot of projects out there, which cover this already.    &lt;br /&gt;Well, that’s true. But as I stated in earlier posts, none of them are really “Embedded”. However, they are good starting points. You might want to take a look at banshee, gstreamer, guliverkli, ffmpeg, codeproject etc.&lt;/p&gt;  &lt;h3&gt;Ingredients&lt;/h3&gt;  &lt;p&gt;To follow this series you will need:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Visual Studio 2008 incl. SmartDevice stuff &lt;/li&gt;    &lt;li&gt;A SDK for your Targetdevice (including the DirectShow stuff and atl) [Projects I post will have binaries for CE6: SH4, CE5: MIPSII. If you provide me SDKs for additional cores I will include them as well] &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.opennetcf.com/Products/SmartDeviceFramework/VisualStudioExtensions/tabid/66/Default.aspx" target="_blank"&gt;OpenNETCF SDF 2.2&lt;/a&gt; (optional, I will try to provide alternative implementations if needed) &lt;/li&gt;    &lt;li&gt;A device for testing will be helpful, but emulator should do for testing as well. &lt;/li&gt;    &lt;li&gt;A SVN Client if you want to get access to the latest sources. I haven't decided yet where to host the project (Codeplex maybe), so for the beginning I might host it myself. &lt;/li&gt;    &lt;li&gt;Some time. This will be an interactive series. After we got the basic layout you will be able to submit input about what to show next. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Motivation and Outlook&lt;/h3&gt;  &lt;p&gt;Why am I doing this?    &lt;br /&gt;Well because I think it’s about time to have something like this available for Windows Embedded CE&lt;/p&gt;  &lt;p&gt;Why a series? Just give me the code!    &lt;br /&gt;Good question. Because the component, as it currently exists, contains some special stuff which is not intended to be released to public and because it’s a grown project and not a turnkey solution. Since I need to rewrite it anyway it’s a golden opportunity to release it as open source.&lt;/p&gt;  &lt;p&gt;What will be the result?    &lt;br /&gt;At the end there might be an “Embedded Media Framework” (Name subject to change, suggestions welcome) which is capable to replace the Mediaplayer on Windows Embedded CE devices in .NET CF environments&amp;#160; and which will have some additional features currently not included in Windows Embedded CE.&lt;/p&gt;  &lt;p&gt;What additional Features?    &lt;br /&gt;Well, like all Frameworks, it will develop over time, but here are some:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Shoutcast/Icecast streams (native 100% done) &lt;/li&gt;    &lt;li&gt;MP4 Demuxer (native 100% done (based on &lt;a href="http://www.gdcl.co.uk/mpeg4/index.htm" target="_blank"&gt;GDCL&lt;/a&gt;)) &lt;/li&gt;    &lt;li&gt;Carousel Control (Managed 100% done) &lt;/li&gt;    &lt;li&gt;Navigation Strip Control (Mediacenter like) (Managed 100% done) &lt;/li&gt;    &lt;li&gt;Playlists (Managed 98% done) &lt;/li&gt;    &lt;li&gt;Full UPnP/DLNA Support (Managed 100% Done (based on &lt;a href="http://www.brains-n-brawn.com/whsUpnp360" target="_blank"&gt;Brains-n-Brawn&lt;/a&gt; modified Intel.Upnp Stack)) &lt;/li&gt;    &lt;li&gt;XAML Support (planned) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Can I see a demo?   &lt;br /&gt;I’ll see if I find time to grab a video so you can get an impression of the results.&lt;/p&gt;  &lt;h3&gt;Timeline&lt;/h3&gt;  &lt;p&gt;Since I have a life beyond blogging it will take some time. But the basics to get things rolling will be available very soon. &lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:59b758a0-14d3-4bb0-8e14-df986d025f78" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/windows+ce" rel="tag"&gt;windows ce&lt;/a&gt;,&lt;a href="http://technorati.com/tags/windows+embedded" rel="tag"&gt;windows embedded&lt;/a&gt;,&lt;a href="http://technorati.com/tags/mediaplayer" rel="tag"&gt;mediaplayer&lt;/a&gt;,&lt;a href="http://technorati.com/tags/.NET+Compact+Framework" rel="tag"&gt;.NET Compact Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/directshow" rel="tag"&gt;directshow&lt;/a&gt;&lt;/div&gt;</description>
      <link>http://www.coppercoins.de/post/2008/11/05/Embedded-Media-Framework-Getting-started-or-Ingredients-needed.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/11/05/Embedded-Media-Framework-Getting-started-or-Ingredients-needed.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=209b91e7-8041-4bc4-b0d8-ed93f550a3f8</guid>
      <pubDate>Wed, 05 Nov 2008 19:30:41 +0200</pubDate>
      <category>.NETCF</category>
      <category>DirectShow</category>
      <category>Mediaplayer</category>
      <category>Embedded Media Framework</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=209b91e7-8041-4bc4-b0d8-ed93f550a3f8</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=209b91e7-8041-4bc4-b0d8-ed93f550a3f8</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/11/05/Embedded-Media-Framework-Getting-started-or-Ingredients-needed.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=209b91e7-8041-4bc4-b0d8-ed93f550a3f8</wfw:commentRss>
    </item>
    <item>
      <title>WMP Part IIIb: new Interop Assembly for Mediaplayer (WMP OCX)</title>
      <description>&lt;p&gt;If you prefer to use the Mediaplayer OCX 7, then you will have to do some Sourcehacking. However it’s not really complicated.&lt;/p&gt;  &lt;p&gt;To start grab the &lt;font color="#0000ff"&gt;wmpocx.dll&lt;/font&gt; from your device (or the release dir) and place it into a Directory “Interop” within your project and &lt;strong&gt;rename&lt;/strong&gt; it to “&lt;font color="#0000ff"&gt;wmpdevice.dll&lt;/font&gt;”. (You will see later on why this necessary).&lt;/p&gt;  &lt;p&gt;1) Create the Interop Assemblies by “&lt;font color="#0000ff"&gt;aximp /source wmpdevice.dll&lt;/font&gt;”. This should create the files &lt;font color="#008000"&gt;AxWMPOCX.cs&lt;/font&gt; , &lt;font color="#008000"&gt;AxWMPOCX.dll&lt;/font&gt;, &lt;font color="#008000"&gt;WMPOCX.dll.&lt;/font&gt;&lt;font color="#000000"&gt;&amp;#160; &lt;/font&gt;As you can see there is a name conflict. This is the reason why you now have to hack a bit. You can safely delete &lt;font color="#008000"&gt;AxWMPOCX.dll&lt;/font&gt; since we are using the source anyway.&lt;/p&gt;  &lt;p&gt;2) Now we need to change the assembly-name to WMPOCX.Interop to prevent naming conflicts.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Disassemble the newly created &lt;font color="#008000"&gt;WMPOCX.dll&lt;/font&gt; by “&lt;font color="#0000ff"&gt;ildasm&amp;#160; /out=WMPOCX.Interop.il wmpocx.dll&lt;/font&gt;” &lt;/li&gt;    &lt;li&gt;Load &lt;font color="#008000"&gt;WMPOCX.Interop.il&lt;/font&gt; into your favorite Texteditor and change the following lines:       &lt;br /&gt;Line 13: &lt;font color="#ff0000"&gt;.assembly WMPOCX&lt;/font&gt;       &lt;br /&gt;becomes       &lt;br /&gt;&lt;font color="#ff0000"&gt;.assembly WMPOCX.Interop&lt;/font&gt;       &lt;br /&gt;      &lt;br /&gt;Line 24: &lt;font color="#ff0000"&gt;.module WMPOCX.dll&lt;/font&gt;       &lt;br /&gt;becomes       &lt;br /&gt;&lt;font color="#ff0000"&gt;.module WMPOCX.Interop.dll&lt;/font&gt;       &lt;br /&gt;      &lt;br /&gt;Save the file. &lt;/li&gt;    &lt;li&gt;Now create the new Interop Assembly by “&lt;font color="#0000ff"&gt;ilasm /dll WMPOCX.Interop.il&lt;/font&gt;”. As always add the necessary signing arguments as needed. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;3) Add the newly created &lt;font color="#008000"&gt;WMPOCX.Interop.dll&lt;/font&gt; to the references of your Project and add &lt;font color="#008000"&gt;AxWMPOCX.cs&lt;/font&gt; to the sources. &lt;/p&gt;  &lt;p&gt;That’s it. You are ready to go.&lt;/p&gt;  &lt;p&gt;Easy isn’t it?&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8d0cfab2-797e-438a-b0f9-a6684b7aa5d1" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Technorati-Tags%3a+windows+ce" rel="tag"&gt;Technorati-Tags: windows ce&lt;/a&gt;,&lt;a href="http://technorati.com/tags/windows+embedded" rel="tag"&gt;windows embedded&lt;/a&gt;,&lt;a href="http://technorati.com/tags/mediaplayer" rel="tag"&gt;mediaplayer&lt;/a&gt;,&lt;a href="http://technorati.com/tags/.NET+Compact+Framework" rel="tag"&gt;.NET Compact Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/activex" rel="tag"&gt;activex&lt;/a&gt;&lt;/div&gt;</description>
      <link>http://www.coppercoins.de/post/2008/11/05/WMP-Part-IIIb-new-Interop-Assembly-for-Mediaplayer-(WMP-OCX).aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/11/05/WMP-Part-IIIb-new-Interop-Assembly-for-Mediaplayer-(WMP-OCX).aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=eb686940-bda6-4490-990b-4efe3ea972ff</guid>
      <pubDate>Wed, 05 Nov 2008 14:32:23 +0200</pubDate>
      <category>.NETCF</category>
      <category>ActiveX</category>
      <category>Embedded CE 6.0 R2</category>
      <category>Mediaplayer</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=eb686940-bda6-4490-990b-4efe3ea972ff</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=eb686940-bda6-4490-990b-4efe3ea972ff</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/11/05/WMP-Part-IIIb-new-Interop-Assembly-for-Mediaplayer-(WMP-OCX).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=eb686940-bda6-4490-990b-4efe3ea972ff</wfw:commentRss>
    </item>
    <item>
      <title>WMP Part IIIa: Creating new Interop Assembly for Mediaplayer</title>
      <description>&lt;p&gt;After working with the stuff from the previous part, you might have noticed that some stuff is not working correctly , and some stuff is not really nice.&lt;/p&gt;  &lt;p&gt;Creating a new Interop Assembly for the Mediaplayer on Windows CE can be a little bit tricky, depending on the approach you make. Basically you can decide between two “different” Mediaplayers on your Windows Embedded.    &lt;br /&gt;You can either use the normal “Windows Media Player OCX” or the “Mediaplayer ActiveX”. The later one is the one usually embedded into web pages. Both have some advantages and disadvantages. &lt;/p&gt;  &lt;p&gt;I usually prefer the ActiveX-Version because it offers me more Functions, allows access of the Filtergraph and I can keep the nifty status-line which will inform about the current status of the control, even if you disable all other UI features.&lt;/p&gt;  &lt;p&gt;So in this post I will explain how to create a new Interop Assembly for the Mediaplayer ActiveX (I will explain it for the OCX in the next post, because it requires some IL-Source hacking).&lt;/p&gt;  &lt;p&gt;1. Grab the files “&lt;font color="#0000ff"&gt;msdxm.dll&lt;/font&gt;” and “&lt;font color="#0000ff"&gt;oleaut32.dll&lt;/font&gt;” from your device, store them to a folder “Interop” in the Project on your development machine. (If your device will not allow to copy them, just grab them from the Release Directory of the Platform Builder)     &lt;br /&gt;2. Open a Visual Studio Command Prompt and navigate to the “Interop” folder     &lt;br /&gt;3. Create an Interop Assembly for oleaut32.dll (You need this because the msdxm imports the stdole namespace) by “&lt;font color="#0000ff"&gt;tlbimp oleaut32.dll&lt;/font&gt;”. (Do not forget to add your keyfile etc to the commandline if you use signed assemblies.)     &lt;br /&gt;This will produce a stdole-Interop Assembly, needed by the Mediaplayer ActiveX.&lt;/p&gt;  &lt;p&gt;4. Now create the Mediaplayer ActiveX Interop:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#0000ff"&gt;AxImp /source msdxm.dll&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If AxImp complains about msdxm.dll not containing any ActiveX-Elements, fire up regedit and create a new Key&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#0000ff"&gt;HKEY_CLASSES_ROOT\CLSID\{22D6F312-B0F6-11D0-94AB-0080C74C7E95}\Control&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This will convince AxImp to gracefully accept the dll and create the required file.&lt;/p&gt;  &lt;p&gt;5. Add a reference to &lt;font color="#0000ff"&gt;stdole.dll&lt;/font&gt; and &lt;font color="#0000ff"&gt;MediaPlayer.dll&lt;/font&gt; to your project, delete the reference to &lt;font color="#0000ff"&gt;wmplib.dll&lt;/font&gt;.&lt;/p&gt;  &lt;p&gt;6. Exclude &lt;font color="#008000"&gt;AxWmp.cs&lt;/font&gt; from the project , add &lt;font color="#008000"&gt;AxMediaPlayer.cs&lt;/font&gt; to it.&lt;/p&gt;  &lt;p&gt;7. Update your references.&lt;/p&gt;  &lt;p&gt;8. Have Fun.&lt;/p&gt;  &lt;p&gt;You can grab my little Testing-App &lt;a href="http://www.coppercoins.de/downloads/mediaplayertest.zip" target="_blank" rel="nofollow"&gt;here&lt;/a&gt; (Windows Embedded CE 6 as base device used).&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a881c4e9-8df2-4a18-890d-fa84935cfca6" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati-Tags: &lt;a href="http://technorati.com/tags/windows+ce" rel="tag"&gt;windows ce&lt;/a&gt;,&lt;a href="http://technorati.com/tags/windows+embedded" rel="tag"&gt;windows embedded&lt;/a&gt;,&lt;a href="http://technorati.com/tags/mediaplayer" rel="tag"&gt;mediaplayer&lt;/a&gt;,&lt;a href="http://technorati.com/tags/.NET+Compact+Framework" rel="tag"&gt;.NET Compact Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/activex" rel="tag"&gt;activex&lt;/a&gt;&lt;/div&gt;</description>
      <link>http://www.coppercoins.de/post/2008/11/03/WMP-Part-IIIa-Creating-new-Interop-Assembly-for-Mediaplayer.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/11/03/WMP-Part-IIIa-Creating-new-Interop-Assembly-for-Mediaplayer.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=5a5ad143-893d-4a46-963c-93f268a5788d</guid>
      <pubDate>Mon, 03 Nov 2008 23:16:42 +0200</pubDate>
      <category>.NETCF</category>
      <category>ActiveX</category>
      <category>Embedded CE 6.0 R2</category>
      <category>Mediaplayer</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=5a5ad143-893d-4a46-963c-93f268a5788d</pingback:target>
      <slash:comments>18</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=5a5ad143-893d-4a46-963c-93f268a5788d</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/11/03/WMP-Part-IIIa-Creating-new-Interop-Assembly-for-Mediaplayer.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=5a5ad143-893d-4a46-963c-93f268a5788d</wfw:commentRss>
    </item>
    <item>
      <title>Interfaces called by WMP on a SourceFilter</title>
      <description>&lt;p&gt;While developing a ShoutCast-Sourcefilter for Windows Embedded it was useful to know which Interfaces the WMP / GraphBuilder actually calls on my Filter.&lt;/p&gt;  &lt;p&gt;So here they are (sequence varies sometimes):&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;// Startup of Filter before LOAD is called&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;{56A86895-0AD4-11CE-B03A-0020AF0BA770} [IBaseFilter]      &lt;br /&gt;{56A86895-0AD4-11CE-B03A-0020AF0BA770} [IBaseFilter]       &lt;br /&gt;{56A868A6-0AD4-11CE-B03A-0020AF0BA770} [IFileSourceFilter]       &lt;br /&gt;{8E1C39A1-DE53-11CF-AA63-0080C744528D} [IAMOpenProgress]       &lt;br /&gt;IFileSourceFilter::Load&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;// When actually the Filter is used&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;{0000010C-0000-0000-C000-000000000046} [IPersist]      &lt;br /&gt;{00000000-0000-0000-C000-000000000046} [IUnknown]       &lt;br /&gt;{36B73880-C2C8-11CF-8B46-00805F6CEF60} [IMediaSeeking]       &lt;br /&gt;{56A868B2-0AD4-11CE-B03A-0020AF0BA770} [IMediaPosition]       &lt;br /&gt;{2DD74950-A890-11D1-ABE8-00A0C905F375} [IAMFilterMiscFlags]       &lt;br /&gt;{56A868B5-0AD4-11CE-B03A-0020AF0BA770} [IBasicVideo]       &lt;br /&gt;{56A868B4-0AD4-11CE-B03A-0020AF0BA770} [IVideoWindow]       &lt;br /&gt;{56A868B3-0AD4-11CE-B03A-0020AF0BA770} [IBasicAudio]       &lt;br /&gt;{FA2AA8F4-8B62-11D0-A520-000000000000} [IAMMediaContent]       &lt;br /&gt;IAMMediaContent::get_AuthorName       &lt;br /&gt;IAMMediaContent::get_Copyright       &lt;br /&gt;IAMMediaContent::get_Title       &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;{56A868B5-0AD4-11CE-B03A-0020AF0BA770}[IBasicVideo]      &lt;br /&gt;{56A868FE-0AD4-11CE-B0A3-0020AF0BA770}[IAMPlayList]       &lt;br /&gt;{56A86897-0AD4-11CE-B03A-0020AF0BA770}[IReferenceClock]&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="ver"&gt;If you are smart you will have noticed 2 Interfaces are called, which are officially not supported by Windows Embedded CE DirectShow:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;IAMOpenProgress , IAMPlayList&lt;/p&gt;  &lt;p&gt;Those can come in handy if you want to be a bit chatty about the progress ;)&lt;/p&gt;  &lt;p&gt;Strange Issue: WMP creates 2 instances of your Filter! First one will be deleted again after Load succeeded.    &lt;br /&gt;Keep this in mind when buffering data in Load or such!&lt;/p&gt;  &lt;p&gt;Strange Issue: WMP will not react to EC_CONTENTPROPERTY_CHANGED-Events from the filter, e.g. to update the title.&lt;/p&gt;  &lt;p&gt;Wonder how to Dump Interfaces and Names? I will post my “HelperSource” soon.&lt;/p&gt;</description>
      <link>http://www.coppercoins.de/post/2008/10/22/Interfaces-called-by-WMP-on-a-SourceFilter.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/10/22/Interfaces-called-by-WMP-on-a-SourceFilter.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=f8b571ee-66a5-4f4f-8f31-4c8ba63c1e89</guid>
      <pubDate>Wed, 22 Oct 2008 02:07:10 +0200</pubDate>
      <category>Embedded CE 6.0 R2</category>
      <category>Mediaplayer</category>
      <category>DirectShow</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=f8b571ee-66a5-4f4f-8f31-4c8ba63c1e89</pingback:target>
      <slash:comments>10</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=f8b571ee-66a5-4f4f-8f31-4c8ba63c1e89</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/10/22/Interfaces-called-by-WMP-on-a-SourceFilter.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=f8b571ee-66a5-4f4f-8f31-4c8ba63c1e89</wfw:commentRss>
    </item>
    <item>
      <title>WMP Part II: Getting AxHost to work on Windows Embedded CE 6.0</title>
      <description>&lt;p&gt;
Now that you read the article on hosting ActiveX and hopefully at least understood parts of it, it&amp;rsquo;s about time to get things rolling. &lt;br /&gt;
The basic code of Alex Feinman should get your started. You create a new SmartDevice-Project and are able to drag the Mediaplayer -Control into it. You can compile it without errors and deploy it, and start it. Yeah! 
&lt;/p&gt;
&lt;p&gt;
However, this is where problems start. You get the all famous &amp;ldquo;Class not registered&amp;rdquo; exception.&lt;br /&gt;
Why is this? You are sure to have the Media Player in your image and you can use the ceplayer without any problems. A quick glance at the source, shows that the uuid of the Media Player is correct, so what is the problem? &lt;br /&gt;
Pretty easy: The code Alex provides is for Desktop, and so the Lines 
&lt;/p&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;
&lt;pre style="margin: 0px"&gt;
&lt;span style="color: blue"&gt;private&lt;/span&gt; WMPLib.IWMPPlayer4 ocx;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; AttachInterfaces() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;try&lt;/span&gt; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.ocx = ((WMPLib.IWMPPlayer4)(&lt;span style="color: blue"&gt;this&lt;/span&gt;.GetOcx()));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;catch&lt;/span&gt; (System.&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt; ) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
cause all the trouble. This will try to cast the IWMPPlayer interface to a IWMPlayer4-Interface, which is not supported by Windows Embedded CE 6. So the first change you have to do is to exchange all (namely the two stated above) occurrences of IWMPPlayer4 in the Source by IWMPPlayer, to make sure the CLR will not try to cast the interface. &lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Now the correct interface will be used and the Windows Media Player OCX will be correctly instantiated.&lt;br /&gt;
But now you get a NullReference-Exception. Stepping into the Code, you will notice this to happen here: 
&lt;/p&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;
&lt;pre style="margin: 0px"&gt;
&lt;span style="color: blue"&gt;int&lt;/span&gt; IOleInPlaceSite.OnUIActivate()
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.host.SetOcState(8);
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.host.GetParentContainer().OnUIActivate(&lt;span style="color: blue"&gt;this&lt;/span&gt;.host);
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt; 0;
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Digging into this you will find in the source: 
&lt;/p&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;
&lt;pre style="margin: 0px"&gt;
AxContainer GetParentContainer() { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;null&lt;/span&gt;; }
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Obviously this will always cause a NullReference-Exception to occur. However you can now try to workaround this issue, but later on you will then notice some strange things to happen. So it&amp;rsquo;s better to find out what this is all about. 
&lt;/p&gt;
&lt;p&gt;
Simple put, an ActiveX-Control always needs a container to live in. However in our Application the Mediaplayer is created &amp;ldquo;standalone&amp;rdquo; and then attached to our form (which is the container! yeah!). Well, again you can find ways to create a workaround but it&amp;rsquo;s always better to do it like it should be done. &lt;br /&gt;
So, how to find out now, what should be done and what is expected to happen?&lt;br /&gt;
There are several ways to find it out: 
&lt;/p&gt;
&lt;p&gt;
A) Google and read a lot about ActiveX, lifecycles, containers, InPlace-Activation and stuff (well you should do this anyway :) )&lt;br /&gt;
B) Using reflector to peek into the Microsoft Desktop-Assemblies and learn what they do with this AxHost Stuff&lt;br /&gt;
C) Learn from other Projects like e.g. Mono how they do it.&lt;br /&gt;
&lt;br /&gt;
Usually I prefer B) because Microsoft should know best how to use their own stuff. So start up reflector and browse through the code for quite a while to find out what is happening there. Basically Microsoft does the following, when an ActiveX-Control is created:&lt;br /&gt;
Make it to live first inside a temporary containercontrol, until it&amp;rsquo;s attached to another containercontrol (usually a form). To speed up things remember this temporary containercontrol in a Property , to reuse this containercontrol for all ActiveX-Controls in the Application and for the very first hosted ActiveX this containercontrol will be created on the fly. 
&lt;/p&gt;
&lt;p&gt;
The reason why this is somehow tackled in a roundabout fashion has to do with the startup of the ActiveX control. While it is transitioning up it will need to know about the size and stuff, which is usually takes from it&amp;rsquo;s container, and this why you need a container at this point because the control does not know about the form yet. 
&lt;/p&gt;
&lt;p&gt;
To implement this in our AxHost is pretty easy. You can Copy&amp;amp;Paste most of the relevant code from reflector. Only this Property-Stuff is a problem. They do not exist in .NET CF. There are several ways to bypass this, and I decided to use the usually unused Tag-Property of the Form to hold the temporary applicationwide containercontrol (this way I can access it later on *wink*). However you can do it another way.&lt;br /&gt;
After implementing this stuff into the AxHost compile and give it a try. 
&lt;/p&gt;
&lt;p&gt;
And &amp;hellip;&amp;hellip;.. (drumroll) &amp;hellip;. no exception, no crash and if you assigned something to the url property your application will gracefully start to playback. (Assuming autostart has been set). 
&lt;/p&gt;
&lt;p&gt;
Now you are ready to play with your new friend. 
&lt;/p&gt;
&lt;p&gt;
Soon enough you will notice some things not to work as expected or some limitations which are really annoying. E.g. if you turn of the UI of the Media player there is no easy way to show states and stuff, you will have to write a lot of event handlers. And be aware! Be really really really really careful about what you are doing in those event handlers! Read the MSDN-Docs carefully. There are some events which really produce odd things if you access your activex wmp from within them. (Usually the MSDN-Docs will tell you if it&amp;rsquo;s safe to change things in this event). For the next days MSDN should become a good friend of you. 
&lt;/p&gt;
&lt;p&gt;
So, if your goal was to get playback into your .NET CF SmartDevice application. You are done now. Live long and prosper, and write a postcard (*cough* leave a comment) if it works for you. 
&lt;/p&gt;
&lt;p&gt;
If you want to dig a little bit deeper, stay tuned for the next episodes, where I will show in depth how to create an Interop-Library for the Windows Media Player 7 OCX (Because some of the dispid are different) on your device, show ways to bypass limitations and creating stable, reliable, rich multimedia applications using .NET CF on a SmartDevice. Also I will write a series about DirectShow on devices, to point out some pitfalls you might want to avoid on your way down the road. 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
You can grab my code &lt;a href="http://www.coppercoins.de/downloads/AxHost.zip" target="_blank"&gt;here&lt;/a&gt;. To see what I changed just look for &amp;ldquo;CONNEXCHANGED&amp;rdquo; in the code. Apart from the containercontrol-stuff I removed some interfaces not supported by the image on my device. If you encounter &amp;ldquo;Interface not supported&amp;rdquo;-Problems just comment out those interfaces like I did. 
&lt;/p&gt;
&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:390e422f-1f08-485c-8d04-f9eccf45beff" class="wlWriterEditableSmartContent" style="display: inline; float: none; margin: 0px; padding: 0px"&gt;
Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/windows+ce"&gt;windows ce&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/windows+embedded"&gt;windows embedded&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/mediaplayer"&gt;mediaplayer&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/.NET+Compact+Framework"&gt;.NET Compact Framework&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/activex"&gt;activex&lt;/a&gt; 
&lt;/div&gt;
</description>
      <link>http://www.coppercoins.de/post/2008/10/19/WMP-Part-II-Getting-AxHost-to-work-on-Windows-Embedded-CE-60.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/10/19/WMP-Part-II-Getting-AxHost-to-work-on-Windows-Embedded-CE-60.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=ced49720-6cd6-41a2-95a5-e5d5fa103e53</guid>
      <pubDate>Sun, 19 Oct 2008 21:01:00 +0200</pubDate>
      <category>.NETCF</category>
      <category>ActiveX</category>
      <category>Embedded CE 6.0 R2</category>
      <category>Mediaplayer</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=ced49720-6cd6-41a2-95a5-e5d5fa103e53</pingback:target>
      <slash:comments>15</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=ced49720-6cd6-41a2-95a5-e5d5fa103e53</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/10/19/WMP-Part-II-Getting-AxHost-to-work-on-Windows-Embedded-CE-60.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=ced49720-6cd6-41a2-95a5-e5d5fa103e53</wfw:commentRss>
    </item>
    <item>
      <title>A Systemsound is a Systemsound and should not influence me!</title>
      <description>&lt;p&gt;
After spending days and nights of tracking down a very strange problem, I thought it&amp;rsquo;s time to share this: 
&lt;/p&gt;
&lt;p&gt;
Under certain, so far unknown circumstances, we had the problem that the message pump kind of stalls/freezes.&lt;br /&gt;
Oh you know what this means&amp;hellip; Loads of *&amp;amp;%!/&amp;amp;%%$ towards Microsoft and a lot of in depth debugging and googling the web. 
&lt;/p&gt;
&lt;p&gt;
What happened: &lt;br /&gt;
Preparing a new release a very very old issue, which has not been seen for almost a year, reappeared: Q&amp;amp;A reports that after X (replace X by any number between 5 and 100) keystrokes the UI will become unresponsive and respond with a delay of Y (Again replace by any number between 1 and 15) seconds. 
&lt;/p&gt;
&lt;h5&gt;Heat 1: Blame the UI Guy&lt;/h5&gt;
&lt;p&gt;
The easiest solution. He did something very cool and broke the rest. But however it turned out he didn&amp;rsquo;t change anything to the message pumps stuff. 
&lt;/p&gt;
&lt;h5&gt;Heat 2: Blame the OSDesign Guy &lt;/h5&gt;
&lt;p&gt;
Second preferred solution. Well, again, he didn&amp;rsquo;t change anything vital to the OSDesign (apart from adding the Media player AxHosting Stuff to the GAC) and he didn&amp;rsquo;t touch the IRDriver. 
&lt;/p&gt;
&lt;h5&gt;Heat 3: Blame Microsoft&lt;/h5&gt;
&lt;p&gt;
Oh the best of all solutions. It must be their fault! They must have changed something vital in the latest QFE. But, they didn&amp;rsquo;t. At least nothing that could influence the message pump or keyboard. 
&lt;/p&gt;
&lt;h5&gt;Heat 4: Countercheck Q&amp;amp;A Brains&lt;/h5&gt;
&lt;p&gt;
Pulling out 2 reference devices, try to reproduce the problem. Erm, not reproducible! It works for us! Ok so we check with the Q&amp;amp;A. And voila, the problem is reproducible at a 9 out of 10 chance. After a &amp;ldquo;byte compare&amp;rdquo; of Q&amp;amp;A and Dev-Devices the only vital difference was: KeyClicks!&lt;br /&gt;
For reproducible reasons the Dev-Devices have turned the SystemSounds off. While they are On on the Q&amp;amp;A Devices. 
&lt;/p&gt;
&lt;p&gt;
So after hours of debugging we found out, that for some (still unknown) reason the wave-device will break and refuse to deliver any samples to the hardware. (We are still investigating this). &lt;br /&gt;
If this happens, the wave device will block until the sample is either discarded or delivered. And now the devil bites. If the IRDriver issues a KeyDown-&lt;em&gt;keybd_event&lt;/em&gt; , this will result in the KeyDown being posted to the queue and a System-KeyClick sound will be raised. If now, the wave device has a problem and can not deliver the systemsound the wavedevice will stall :( And the calling thread will freeze until the sound is delivered. &lt;br /&gt;
Something we only found out, because some test-programs showed the message pump is working correctly and the keybd_event is causing the delay. 
&lt;/p&gt;
&lt;p&gt;
But, wtf, why is a system sound able to block the keybd_event-call? It&amp;rsquo;s a systemsound! It should never influence the device/app (imho!). 
&lt;/p&gt;
&lt;p&gt;
Just my 2 coppers &amp;hellip; 
&lt;/p&gt;
</description>
      <link>http://www.coppercoins.de/post/2008/10/07/A-Systemsound-is-a-Systemsound-and-should-not-influence-me!.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/10/07/A-Systemsound-is-a-Systemsound-and-should-not-influence-me!.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=029fd758-c119-477d-9586-b2f1e5eec19c</guid>
      <pubDate>Tue, 07 Oct 2008 01:42:00 +0200</pubDate>
      <category>.NETCF</category>
      <category>Embedded CE 6.0 R2</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=029fd758-c119-477d-9586-b2f1e5eec19c</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=029fd758-c119-477d-9586-b2f1e5eec19c</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/10/07/A-Systemsound-is-a-Systemsound-and-should-not-influence-me!.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=029fd758-c119-477d-9586-b2f1e5eec19c</wfw:commentRss>
    </item>
    <item>
      <title>System.IO.Directory.CreateDirectory fails on MountHidden Volume</title>
      <description>&lt;p&gt;
System.IO.Directory.CreateDirectory fails on a CE 6 R2 Device with .Net CF 3.5 if the Path contains a Hidden Volume (Mounted with MountHidden=1).&lt;br /&gt;
CreateDirectory tries to create the Hidden-Volume, which fails of course.&lt;br /&gt;
Workaround: 
&lt;/p&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;
&lt;pre style="margin: 0px"&gt;
        [&lt;span style="color: #2b91af"&gt;DllImport&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;coredll.dll&amp;quot;&lt;/span&gt;)]
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style="color: blue"&gt;return&lt;/span&gt;: &lt;span style="color: #2b91af"&gt;MarshalAs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;UnmanagedType&lt;/span&gt;.Bool)]
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;internal &lt;/span&gt;&lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;extern&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; CreateDirectoryW(&lt;span style="color: blue"&gt;string&lt;/span&gt; lpPathName, 
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt; lpSecurityAttributes);
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; CreateDirectory(&lt;span style="color: blue"&gt;string&lt;/span&gt; lpPathName)
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;Environment&lt;/span&gt;.OSVersion.Platform != &lt;span style="color: #2b91af"&gt;PlatformID&lt;/span&gt;.WinCE)
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Directory&lt;/span&gt;.CreateDirectory(lpPathName) != &lt;span style="color: blue"&gt;null&lt;/span&gt;;
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;else&lt;/span&gt;
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt; CreateDirectoryW(lpPathName, &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero);
&lt;/pre&gt;
&lt;pre style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
If you think this is something the NET CF-Team should change in the next Version you can state your opinion &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=356194" target="_blank" search="?FeedbackID=356194"&gt;here&lt;/a&gt;. 
&lt;/p&gt;
</description>
      <link>http://www.coppercoins.de/post/2008/10/07/SystemIODirectoryCreateDirectory-fails-on-MountHidden-Volume.aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/10/07/SystemIODirectoryCreateDirectory-fails-on-MountHidden-Volume.aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=ea7726ee-aa11-424f-bd24-8a4d7e154608</guid>
      <pubDate>Tue, 07 Oct 2008 00:24:00 +0200</pubDate>
      <category>.NETCF</category>
      <category>Embedded CE 6.0 R2</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=ea7726ee-aa11-424f-bd24-8a4d7e154608</pingback:target>
      <slash:comments>8</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=ea7726ee-aa11-424f-bd24-8a4d7e154608</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/10/07/SystemIODirectoryCreateDirectory-fails-on-MountHidden-Volume.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=ea7726ee-aa11-424f-bd24-8a4d7e154608</wfw:commentRss>
    </item>
    <item>
      <title>WMP Part I: Getting started with Windows Media Player (Objectives , Problems , Possible approaches)</title>
      <description>&lt;ul&gt;
	&lt;li&gt;Developing on a Windows Embedded CE device using .NET CF? &lt;/li&gt;
	&lt;li&gt;Tried hours and hours to embed the Mediaplayer into your application? &lt;/li&gt;
	&lt;li&gt;Searched the web for days for a solution, but only found people having the same problem?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
No need to search any further. I will start a series on how to successfully embed the Windows Mediaplayer in a .NET CF Application. After reading through this, you should be able to host the Mediaplayer in your app. If not, I will do it for you.&lt;br /&gt;
But be aware this will include some work. If you want a quick and &amp;quot;dirty&amp;quot; working solution, step by opennetcf.org and grab their Mediaplayer-control. It works smoothly. 
&lt;/p&gt;
&lt;h5&gt;Part I: Objectives , Problems , Possible approaches&lt;/h5&gt;
&lt;p&gt;
Driving a Windows Embedded CE Device to the next Generation always incorporates integration of the Windows Mediaplayer/DirectShow in some way. But well here the problems starts. Embedded CE comes with a full-featured WMP OCX and hey, it&amp;#39;s nice to use it in those samples provided (e.g. ceplayer).&lt;br /&gt;
Then you automatically think, hey I want this in my .NET CF Application. So you startup you Visual Studio, create a new SmartDevice-Solution, start a Windows Form Project, add those nifty &amp;quot;musthaves&amp;quot; like e.g. OpenNETCF, open the designer and search the toolbox for the Mediaplayer control. &lt;br /&gt;
Hmm ... It&amp;#39;s not there. Must be a Bug. It is there for Desktop-applications. Reboot, Repair of VS-Installation but it&amp;#39;s still not there. You spent some hours already, Google around and find the answer which makes you cry: 
&lt;/p&gt;
&lt;p align="center"&gt;
&amp;nbsp;&lt;em&gt;&amp;quot;.NET CF does not support ActiveX hosting&lt;/em&gt;&amp;quot;. 
&lt;/p&gt;
&lt;p&gt;
Try 1:&lt;br /&gt;
But hey, I am smart! .NET CF does support a webbrowser control. So the idea is to simply create a html file, which embeds the mediaplayer and simply pass the playbackurl by altering the html at runtime.&lt;br /&gt;
This works pretty nice, all I need, including playlists / asxfiles etc are working.&lt;br /&gt;
However: Sometimes the surrounding .NET CF application looses the focus and it takes quite some JavaScript hacking to bypass this. And this is not really fun on a 200Mhz device!&lt;br /&gt;
Ok so, we write a little native app which runs in background, monitoring the foreground window, and setting it back if needed. UhOh. Goodbye Device-Independent-Coding. But hey it works. Leaves the only problem that it&amp;#39;s terribly slow, I have no real control from the app and sometimes the webbrowser-control will simply deadlock, pulling the whole application into the &amp;quot;notresponding&amp;quot;-hell. 
&lt;/p&gt;
&lt;p&gt;
Try 2:&lt;br /&gt;
Ok looking around for a solution. You find quite some on the net, but most of them are for PPC and such. Almost nothing available for CE devices, and if, then it&amp;#39;s not available for your XYZ-Core (SH4 in my case). Spending a lot of time trying to get some of the opensource players (gstreamer, coreplayer , tcmpc) compiled for your platform, without success. 
&lt;/p&gt;
&lt;p&gt;
Try 3:&lt;br /&gt;
Okok , there was some article at Microsoft about hosting ActiveX-Control in .NET. So you get back to that, download the sample, compile (hey no errors), deploy it to the machine .... *crash*. Some stepping into the code will bring up the infamous &amp;quot;Interface not supported&amp;quot; and while trying to understand how this stuff works, you give up again. Hey I want to do .NET and not this native COM crap. 
&lt;/p&gt;
&lt;p&gt;
Try 4:&lt;br /&gt;
Being really frustrated you decide to take the A-Train and implement a native DirectShow-wrapper. This is quite easy and with the help of the MessageWindow-Helperclass you have full control and feedback on the playback. But things start to get complicated when it gets to playlists (e.g. ASX-Files). Mediaplayer handles all this smoothly, but hey now I have to do it myself *sigh*. So you implement playlist parsers and all this stuff, to find out, that there is a timing problem if the clips are very short (e.g. about 5 seconds) and that there is sometimes a problem with RenderFile simply blocking for about 60 seconds. But hey, after doing all this you finally understood how all this SourceFilter-Crap is working (or erm well you think so). 
&lt;/p&gt;
&lt;p&gt;
Try 5:&lt;br /&gt;
Well, sigh, this leaves only the backflip to &amp;quot;Try 3&amp;quot; and trying to get this damn thing running. It must be possible! Reading the article over and over again, reading though newsgroups etc. picking up some piece of information and certain places, and hey it works!&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
So while you are waiting for the next part: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Read &lt;a href="http://msdn.microsoft.com/en-us/library/aa446515.aspx" target="_blank"&gt;Hosting ActiveX Controls in the .NET Compact Framework 2.0&lt;/a&gt; . And if I say READ then I mean READ IT and try to understand it! &lt;/li&gt;
	&lt;li&gt;Download the supplied sample and install it. &lt;/li&gt;
	&lt;li&gt;Exchange AxHost.cs by the fixed version from Chris Tacke: &lt;a href="http://blog.opennetcf.com/ctacke/2008/08/14/BugInMSDNActiveXHostingCode.aspx" target="_blank"&gt;Bug in MSDN ActiveX Hosting code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Oh and btw. all the following parts, samples and code-snippets will be .NET CF 3.5 based, but i don&amp;#39;t think there is a problem with .NET CF 2.0. 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:61e3e67a-dbd2-478c-bafa-0f0c17f2fcda" class="wlWriterSmartContent" style="display: inline; float: none; margin: 0px; padding: 0px"&gt;
Technorati-Tags: &lt;a rel="tag" href="http://technorati.com/tags/windows%20ce"&gt;windows ce&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/windows%20embedded"&gt;windows embedded&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/mediaplayer"&gt;mediaplayer&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/.NET%20Compact%20Framework"&gt;.NET Compact Framework&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/activex"&gt;activex&lt;/a&gt; 
&lt;/div&gt;
</description>
      <link>http://www.coppercoins.de/post/2008/10/02/WMP-Part-I-Getting-started-with-Windows-Media-Player-(Objectives-Problems-Possible-approaches).aspx</link>
      <author>connex</author>
      <comments>http://www.coppercoins.de/post/2008/10/02/WMP-Part-I-Getting-started-with-Windows-Media-Player-(Objectives-Problems-Possible-approaches).aspx#comment</comments>
      <guid>http://www.coppercoins.de/post.aspx?id=0489f7b5-60b0-4fdd-b071-9f30b8ba7f94</guid>
      <pubDate>Thu, 02 Oct 2008 22:53:00 +0200</pubDate>
      <category>.NETCF</category>
      <category>ActiveX</category>
      <category>Embedded CE 6.0 R2</category>
      <category>Mediaplayer</category>
      <dc:publisher>connex</dc:publisher>
      <pingback:server>http://www.coppercoins.de/pingback.axd</pingback:server>
      <pingback:target>http://www.coppercoins.de/post.aspx?id=0489f7b5-60b0-4fdd-b071-9f30b8ba7f94</pingback:target>
      <slash:comments>14</slash:comments>
      <trackback:ping>http://www.coppercoins.de/trackback.axd?id=0489f7b5-60b0-4fdd-b071-9f30b8ba7f94</trackback:ping>
      <wfw:comment>http://www.coppercoins.de/post/2008/10/02/WMP-Part-I-Getting-started-with-Windows-Media-Player-(Objectives-Problems-Possible-approaches).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.coppercoins.de/syndication.axd?post=0489f7b5-60b0-4fdd-b071-9f30b8ba7f94</wfw:commentRss>
    </item>
  </channel>
</rss>