<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://code.msdn.microsoft.com/rss.xsl"?><rss version="2.0"><channel><title>WM24HoursPart7 Wiki Rss Feed</title><link>http://code.msdn.microsoft.com/WM24HoursPart7/Wiki/View.aspx?title=Home</link><description>WM24HoursPart7 Wiki Rss Description</description><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/WM24HoursPart7/Wiki/View.aspx?title=Home&amp;version=2</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Resource Page Description&lt;/b&gt;&lt;br /&gt;Even though the .NET Compact Framework contains a lot of functionality, there are situations where you need to make use of native Win32 APIs in order to get your job done. Calling native APIs from inside a managed application is known as P&amp;#47;Invoke.
&lt;br /&gt; &lt;br /&gt;On this Code Gallery page you will find the accompanying sample code of the webcast titled &lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&amp;amp;EventID=1032389651&amp;amp;CountryCode=US" class="externalLink"&gt;24 Hours of Windows Mobile Application Development: Interoperability between managed and native code&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt;The first sample available in the downloadable Visual Studio 2008 solution, called &lt;b&gt;SimplePInvoke&lt;/b&gt; shows you how you can call out to &lt;b&gt;PowerPolicyNotify&lt;/b&gt; API to put your Windows Mobile 6 Professional Device into Suspend mode. PowerPolicyNotify accepts two value types as parameters and returns another value type.&lt;br /&gt; &lt;br /&gt;The second sample, called AdvancedPInvoke is a little more complex. This sample shows you how to P/Invoke to the &lt;b&gt;EnumWindows&lt;/b&gt; API that expects a callback function as one of its parameters. This effectively means that we are calling native code from inside managed code, but that the native API calls back into managed code as well. This functionality is supported in the .NET Compact Framework 2.0 or higher.&lt;br /&gt; &lt;br /&gt;The last sample shows you the support for COM Interoperability inside a managed smart device application. The project CalculatorAppV2 makes use of an existing COM Object (that also ships as part of the sample code) and shows you how to call methods on the COM Object and how the COM Object can call back into managed code. This functionality is supported in the .NET Compact Framework 2.0 or higher.&lt;br /&gt; &lt;br /&gt;For more information about interoperability between managed code and native code on Windows Mobile Devices, you can take a look at Webcast in which we showed this sample code. This Webcast is currently available for &lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&amp;amp;EventID=1032389651&amp;amp;CountryCode=US" class="externalLink"&gt;on-demand viewing&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Maarten_MVP</author><pubDate>Wed, 03 Dec 2008 13:02:54 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20081203P</guid></item></channel></rss>