VB.NET wrapper for VB6 OCX

A while back I successfully built a VB.NET user control as a wrapper for a VB6 OCX. I now have to do the same thing but for a non Win Forms application i.e. a ASP.NET app.

Is it possible to build a .NET assembly that can be called from a formless application (another assembly/ASP.NET/web service) that wraps the VB6 OCX

The control itself has no graphical presence only a handful of properties, method and events.

Any advice appreciated.



Answer this question

VB.NET wrapper for VB6 OCX

  • Mehta Vikas

    Thanks for the tip (it'll be useful) but I'm not sure how I can use a VB6 OCX control either directly or by using a .NET wrapper without having a form to place it on.

    My aim is to have a flexible solution where I can call the functions of the control either directly from ASP.NET (or from the code behind), or have the ASP call a web service which calls the control.

    Any advice appreciated.


  • ste_brough

    It is possible to call a COM component from an Asp.Net application as long as you're not planning on showing any of the UI to the user. You'll have to set the compatability mode to asp to get the apartment model correct. The tag is <@%Page aspcompat="true" %>

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpgenref/html/cpconpage.asp



  • VB.NET wrapper for VB6 OCX