MSDN Archive Home
Help and FAQs
Windows Mobile Webcast – Interoperability between managed and native code
All Resource Updates
Change History (all pages)
Resource Page Description
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/Invoke.
On this Code Gallery page you will find the accompanying sample code of the webcast titled
24 Hours of Windows Mobile Application Development: Interoperability between managed and native code
The first sample available in the downloadable Visual Studio 2008 solution, called
shows you how you can call out to
API to put your Windows Mobile 6 Professional Device into Suspend mode. PowerPolicyNotify accepts two value types as parameters and returns another value type.
The second sample, called AdvancedPInvoke is a little more complex. This sample shows you how to P/Invoke to the
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.
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.
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
Dec 3 2008 at 1:02 PM
, version 2
Sign in to add a comment
Thu Oct 15 2009 at 7:00 AM
More Tags ...
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Manage Your Profile
MSDN Flash Newsletter
© 2008 Microsoft Corporation. All rights reserved.