Redigera

Dela via


Windows Forms and Unmanaged Applications

Windows Forms applications and controls can interoperate with unmanaged applications, with some caveats. The following sections describe the scenarios and configurations that Windows Forms applications and controls support and those that they do not support.

In This Section

Windows Forms and Unmanaged Applications Overview Offers general information about how to use and implement Windows Forms controls that work with unmanaged applications.

How to: Support COM Interop by Displaying a Windows Form with the ShowDialog Method Provides a code example that shows how to use the Form.ShowDialog method to run a Windows Form in an unmanaged application.

How to: Support COM Interop by Displaying Each Windows Form on Its Own Thread Provides a code example that shows how to run a Windows Form on its own thread.

Also see Walkthrough: Supporting COM Interop by Displaying Each Windows Form on Its Own Thread.

Reference

Form.ShowDialog
Used to create a separate thread for a Windows Form.

Application.Run
Starts a message loop for a thread.

Invoke
Marshals calls from an unmanaged application to a form.

Exposing .NET Framework Components to COM Offers general information about how to use .NET Framework types in unmanaged applications.