VB6 Components in ASP.NET

Results 1 to 2 of 2

Thread: VB6 Components in ASP.NET

  1. #1
    Join Date
    Dec 1969

    Default VB6 Components in ASP.NET

    I am trying to consume my old vb6 components in my asp.net project by simply adding them to the in directory. This is not working as of right now. Am I going to have to write vb.net wrappers for all of my old components to work in .NET? Will *that* even work, or does the whole component have to be compiled in .NET to run on the platform? If I can provide more detail or clarity in this question, please let me know. Thanks in advance.

  2. #2
    Join Date
    Dec 1969

    Default RE: VB6 Components in ASP.NET

    You can use your old COM components. Just register them via regsvr32 like you would do for ASP, then create instances of them like so:<BR><BR>Dim obj<BR>obj = Server.CreateObject("ProgID")<BR><BR>Note that you will also need to add:<BR><BR>&#060;%@ Page ASPCompat="True" %&#062;<BR><BR>to the top of your ASP.NET Web page. This tells ASP.NET that you&#039;re using old COM components that may use single threaded apartments (STAs), meaning that ASP.NET switches from a multi-threaded apartment model to an STA model for that page. This can have a perf degradation, hence the benefit of creating a VB.NET wrapper. There are also free tools in the .NET SDK for creating .NET wrappers for existing COM components.<BR><BR>Happy Programming!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts