Search code examples
.netmfcocx

Difference between .ocx file and a .Net Control


What is the difference between an .OCX file created in MFC or VB and a .Net control created in C#?

  1. Is it possible to use the .Net Control in a MFC application?

  2. I have a dialog in C# I need to use the same dialog in MFC.whether can I import the entire dialog into Mfc ,or can i save my C# application as .OCX file and use it in MFC?


Solution

  • The main difference: .ocx is unmanaged because MFC is unmanaged, .NET controls are managed (if you don't try to use MFC in .NET, or other unmanaged stuff).

    I think you can't save your .NET app as .ocx file, at least there is no standard way to do this, but you can still use .NET controls in C++ because they can be registered for COM interop.