Belmiris
Belmiris

Reputation: 2805

Do .NET Winforms controls use MSCOMCTL.OCX?

I am (finally!) in the process of converting our VB6 applications to .NET (C#). I would like to use Winforms (I hope to quickly switch to MVC and make them web applications after that). We recently had some serious bizarre problems with our VB6 application on Server 2012 that I suspect may have been caused by MSCOMCTL.OCX (actually that prompted the rewrite). The more I learned about this OCX, the more I wanted to stay away from it. I'm not sure how to find out whether or not the .NET Winforms framework uses these old ActiveX components. I'm hoping someone knows or could point me in a direction to find out. I want to avoid the messy learning curve of WPF.

Upvotes: 1

Views: 861

Answers (1)

Cody Gray
Cody Gray

Reputation: 244823

No.

The OCX extension indicates an ActiveX control. They are indeed used by the classic COM-based VB system (the latest, greatest version of which is VB 6), but they are not used by the .NET Framework. WinForms provides its own unrelated implementation of the common controls. So instead, you'll have a whole new set of bugs to contend with!

Do note that you can use ActiveX controls with WinForms, and this may well be what you end up inadvertently doing if you try to convert the VB 6 project to a .NET project using some automated conversion wizard. I'm not sure, it would depend on the quality of your wizard. Generally, there would be no reason to ever use MSCOMCTL.OCX, since all of the common controls are provided by WinForms, but if your app depends on other ActiveX controls that have no equivalent, a conversion wizard would very likely try and reuse them.

(I don't know what problem you had with MSCOMCTL.OCX on Server 2012. There should not be any significant issues. VB 6 apps continue to run just fine on newer versions of Windows. Make sure that you're running the latest version of the file from the cumulative update rollup. A massive rewrite for a simple bug seems like overkill to me.)

Upvotes: 3

Related Questions