Migrating Native Code to the .NET Framework
This document provides information about how to migrate existing native code applications to the .NET Framework. This document also provides resources that can help you take advantage of your existing programming knowledge when it is necessary for you to move to the .NET Framework.
The following resources can help you port your existing applications to the .NET Framework.
Migrating from Win32 to the .NET Framework
Migrating from Visual Basic 6.0 to Visual Basic 2010
Migrating from ATL/STL to the .NET Framework
Migrating from the C Runtime (CRT) to the .NET Framework
Migrating from the Microsoft Foundation Classes (MFC) to the .NET Framework
Migrating from ADO to ADO.NET
Migrating from DCOM to the .NET Framework
Migrating from ASP to ASP.NET
Multithreaded Programming
Many native code features of the Windows SDK for Windows 7 and the .NET Framework 4 (later referred to as the Windows SDK) have equivalent or similar counterparts in managed code. This section describes how native technologies are represented in the .NET Framework.
Some features in the Windows SDK that use native code cover a broader scope than the corresponding .NET Framework features. From managed code, to access native features that do not have equivalent implementations in the .NET Framework, use Platform Invoke (P/Invoke) or COM interoperation. You can also use C++/CLI to access managed features from native code. For more information about interoperation between native code and managed code, see Interoperating Between Native Code and Managed Code.
The following table shows the relationships between native features and their managed equivalents.
Windows Technology (Native) | .NET Framework and Other Technologies (Managed) | Remarks |
|---|---|---|
Accessibility |
| |
Active Directory Service Interfaces (ADSI) |
| |
Application recovery | No managed equivalent or wrapper. |
|
Audio and video |
| |
Background Intelligent Transfer Service (BITS) | No managed equivalent or wrapper. | For more information, see ClickOnce Deployment for Windows Forms Applications. |
Bluetooth | No managed equivalent or wrapper. |
|
Collaboration Data Objects (CDO) |
| |
Component Object Model (COM) | No managed equivalent or wrapper. | Use the System.Runtime.InteropServices namespace to enable COM from the Microsoft .NET Framework. |
COM+ | This namespace wraps the underlying COM+ functionality. | |
Configuration, instrumentation, logging, security, exception handling | Enterprise Library | For more information, see GotDotNet CodeGallery: Enterprise Library. |
Cryptography | See also the Enterprise Library Cryptography Application Block. | |
Debugging | Native applications can load the common language runtime (CLR); see Unmanaged API Reference. | |
Deployment |
| |
Devices |
| |
Distributed COM (DCOM) |
| |
Device I/O | Microsoft.VisualBasic.Devices, Microsoft.WindowsMobile.DirectX, Microsoft.WindowsCE.Forms, System.Web.UI.MobileControls, System.Web.Mobile | SetupDi* functions are not available. See also .NET Compact Framework. |
Directory services |
| |
DLLs, processes, and threads | See also AppDomain and BackgroundWorker types. | |
Domain Name System (DNS) | See the Dns type. | |
Dynamic Host Configuration Protocol (DHCP) |
| |
Event logging | See also the Enterprise Library Logging Application Block. | |
Extensible Authentication Protocol (EAP) |
| |
Fax services | No managed equivalent or wrapper. |
|
File services |
| |
Function discovery |
| |
GDI+ |
| |
Graphics and media |
| |
HTTP Server | See the HttpListener type. | |
Image Color Management (ICM) |
| |
Indexing services | No managed equivalent or wrapper. |
|
Internet Authentication Service (IAS) | No managed equivalent or wrapper. |
|
Internet Connection Sharing and Internet Connection Firewall (ICS/ICF) | No managed equivalent or wrapper. |
|
Interprocess communication | System.Runtime.Remoting, System.Runtime.Serialization, System.Web.Services |
|
Internet Protocol (IP) Helper | IP Helper and System.Net.NetworkInformation are similar, but not equivalent, technologies. | |
Infrared Data Association (IrDA) support |
| |
Memory management | No managed equivalent or wrapper. | Native applications can load the CLR; see Unmanaged API Reference. |
Messaging | Windows Communication Foundation | For more information, see Getting Started with Windows Communication Foundation. |
Message queuing | The Windows Communication Foundation is built on the System.Messaging namespace. | |
Messaging Application Programming Interface (MAPI) |
| |
Microsoft Data Access Components (MDAC) | The System.Data namespace is also known as ADO.NET. | |
Microsoft Management Console (MMC) | Microsoft.ManagementConsole Microsoft.ManagementConsole.Advanced |
|
Microsoft Speech |
| |
Microsoft Transaction Server (MTS) |
| |
Monitor configuration | No managed equivalent or wrapper. |
|
Microsoft Challenge-Handshake Authentication Protocol (MS-CHAP) password management | No managed equivalent or wrapper. |
|
Microsoft XML Core Services (MSXML) |
| |
Multicast Address Dynamic Client Allocation Protocol (MADCAP) |
| |
Native WiFi | No managed equivalent or wrapper. |
|
NetShell | No managed equivalent or wrapper. |
|
Network Access Protection (NAP) | No managed equivalent or wrapper. |
|
Network Address Translation (NAT) Traversal | No managed equivalent or wrapper. |
|
Network diagnostics |
| |
Network Location Awareness (NLA) | No managed equivalent or wrapper. |
|
Network management |
| |
Network Monitor |
| |
OpenGL | System.Windows.Media.Media3D, Microsoft.WindowsMobile.DirectX.Direct3D | See also Managed DirectX. |
PC Health | No managed equivalent or wrapper. |
|
Peer-to-peer networking | The Windows Communication Foundation implements peer-to-peer networking. | |
Performance monitoring | See also the Enterprise Library for instrumentation solutions. | |
Power management | See the PowerState, PowerStatus, and PowerModes types. | |
Print schema |
| |
Quality of Service (QOS) |
| |
Real-Time Communications (RTC) | No managed equivalent or wrapper. |
|
Remote Access Service (RAS) | No managed equivalent or wrapper. |
|
Remote Procedure Call (RPC) |
| |
Restart Manager | No managed equivalent or wrapper. |
|
Rights management |
| |
Routing and Remote Access Service (RRAS) | No managed equivalent or wrapper. |
|
Security authentication and authorization |
| |
Security management | See also the Enterprise Library Security Application Block. | |
SetupAPI | For more information, see ClickOnce Deployment for Windows Forms Applications. | |
Simple Network Management Protocol (SNMP) | No managed equivalent or wrapper. |
|
Still Image (STI) |
| |
Synchronization Manager |
| |
System Restore | No managed equivalent or wrapper. |
|
System shutdown | See the Application type. | |
Task Scheduler | No managed equivalent or wrapper. |
|
Telephony API (TAPI) | No managed equivalent or wrapper. |
|
Terminal Services | No managed equivalent or wrapper. |
|
Text Services Framework | No managed equivalent or wrapper. |
|
Universal Plug and Play (UPnP) | No managed equivalent or wrapper. |
|
Windows clustering | No managed equivalent or wrapper. |
|
Windows controls | The System.Windows.Forms namespace wraps the Win32 controls from Comctl32.dll. The System.Windows.Controls namespace provides similar functionality by using WPF elements. | |
Windows File Protection | No managed equivalent or wrapper. |
|
Windows Filtering Platform | No managed equivalent or wrapper. |
|
Windows Firewall | No managed equivalent or wrapper. |
|
Windows Image Acquisition (WIA) |
| |
Windows Installer | For more information, see ClickOnce Deployment for Windows Forms Applications. | |
Windows Internet (WinINet) |
| |
Windows Management Instrumentation (WMI) |
| |
Windows Messenger | No managed equivalent or wrapper. |
|
Windows Multimedia |
| |
Windows NetMeeting | No managed equivalent or wrapper. |
|
Windows Networking (WNet) |
| |
Windows Remote Management (WinRM) | No managed equivalent or wrapper. |
|
Windows Server Update Services (WSUS) | No managed equivalent or wrapper. |
|
Windows Sockets |
| |
Windows System Assessment (WinSAT) | No managed equivalent or wrapper. |
|
Windows User Interface |
|