User Control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lou

    #1

    User Control

    How do I create a User Control or .dll in VB .Net to be used in VB6?

    -Lou


  • Herfried K. Wagner [MVP]

    #2
    Re: User Control

    "Lou" <lou.garvin@com cast.net> schrieb:[color=blue]
    > How do I create a User Control or .dll in VB .Net to be used in VB6?[/color]


    For code-only DLLs, check "Register for COM interop" in the project
    properties and reference the generated TLB file from within the VB6 project.
    ..NET user controls cannot be used on VB6 forms.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Lou

      #3
      Re: User Control

      Its a user control that I want the form to show up in VB6
      I did check the "Register for COM interop" box and that was very helpfull
      but I don't get the form to show up in VB6

      VB6 code
      Dim x As New UserControl1


      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
      news:OQ8pP7TlGH A.3776@TK2MSFTN GP03.phx.gbl...[color=blue]
      > "Lou" <lou.garvin@com cast.net> schrieb:[color=green]
      >> How do I create a User Control or .dll in VB .Net to be used in VB6?[/color]
      >
      >
      > For code-only DLLs, check "Register for COM interop" in the project
      > properties and reference the generated TLB file from within the VB6
      > project. .NET user controls cannot be used on VB6 forms.
      >
      > --
      > M S Herfried K. Wagner
      > M V P <URL:http://dotnet.mvps.org/>
      > V B <URL:http://classicvb.org/petition/>[/color]


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: User Control

        "Lou" <lou.garvin@com cast.net> schrieb:[color=blue]
        > Its a user control that I want the form to show up in VB6
        > I did check the "Register for COM interop" box and that was very helpfull
        > but I don't get the form to show up in VB6
        >
        > VB6 code
        > Dim x As New UserControl1[/color]

        As I already said, this is not supported!

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://classicvb.org/petition/>

        Comment

        • Lou

          #5
          Re: User Control

          Sorry about that, I didn't put 2 and 2 together on that.

          Hers my situation...
          We have an application written in C++(I was using vb6 as a test, still the
          best test language in the Universe)
          that allows for users to create plugins. The plug-in architect has both code
          only and UI interfaces. Both are
          needed to create a sucessfull plugin. This is done in VB6 by creating a user
          control. The ctl is used to interface with the plug-in UI and then
          in VB6 another class is added which communicates to the Plug-in code only
          interface. The 2 work in concert. Works beautifully
          How can I do this with .Net?

          Is this at all possible. We have many useres world wide who would like to
          create plug-in's using .Net.
          Can something be done on the C++ app to handles this?

          Thanks for your help and expertise.

          -Lou


          "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
          news:OWo79MUlGH A.3740@TK2MSFTN GP02.phx.gbl...[color=blue]
          > "Lou" <lou.garvin@com cast.net> schrieb:[color=green]
          >> Its a user control that I want the form to show up in VB6
          >> I did check the "Register for COM interop" box and that was very helpfull
          >> but I don't get the form to show up in VB6
          >>
          >> VB6 code
          >> Dim x As New UserControl1[/color]
          >
          > As I already said, this is not supported!
          >
          > --
          > M S Herfried K. Wagner
          > M V P <URL:http://dotnet.mvps.org/>
          > V B <URL:http://classicvb.org/petition/>[/color]


          Comment

          • CodeMonkey

            #6
            Re: User Control

            Lou wrote:[color=blue]
            > Sorry about that, I didn't put 2 and 2 together on that.
            >
            > Hers my situation...
            > We have an application written in C++(I was using vb6 as a test, still the
            > best test language in the Universe)
            > that allows for users to create plugins. The plug-in architect has both code
            > only and UI interfaces. Both are
            > needed to create a sucessfull plugin. This is done in VB6 by creating a user
            > control. The ctl is used to interface with the plug-in UI and then
            > in VB6 another class is added which communicates to the Plug-in code only
            > interface. The 2 work in concert. Works beautifully
            > How can I do this with .Net?
            >
            > Is this at all possible. We have many useres world wide who would like to
            > create plug-in's using .Net.
            > Can something be done on the C++ app to handles this?
            >
            > Thanks for your help and expertise.
            >
            > -Lou
            >
            >
            > "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
            > news:OWo79MUlGH A.3740@TK2MSFTN GP02.phx.gbl...[color=green]
            >> "Lou" <lou.garvin@com cast.net> schrieb:[color=darkred]
            >>> Its a user control that I want the form to show up in VB6
            >>> I did check the "Register for COM interop" box and that was very helpfull
            >>> but I don't get the form to show up in VB6
            >>>
            >>> VB6 code
            >>> Dim x As New UserControl1[/color]
            >> As I already said, this is not supported!
            >>
            >> --
            >> M S Herfried K. Wagner
            >> M V P <URL:http://dotnet.mvps.org/>
            >> V B <URL:http://classicvb.org/petition/>[/color]
            >
            >[/color]

            I have done stuff like this before. You can only show forms created in
            ..Net, you cannot place a "user control" on the VB6 application. For
            example, we have a scanner interface that we developed in VB.Net and
            created a COM interop assembly. In this assembly we have a form that
            will popup and the user can select the source, scan an image, save it,
            view it, etc. This is all controlled through the assembly. You can then
            create methods and properties to communicate the data back to the VB6
            application. Just remember, it will show up as a separate form and not
            embedded on the VB6 forms.

            Comment

            • Lou

              #7
              Re: User Control

              Since this is a plug-n it needs to be hosted within the C++ app and cannot
              be a seperate or pop up form.
              it needs to live in a special place in the C++ app.

              "CodeMonkey " <spammers@suck. com> wrote in message
              news:sGemg.6996 1$4L1.3684@news svr11.news.prod igy.com...[color=blue]
              > Lou wrote:[color=green]
              >> Sorry about that, I didn't put 2 and 2 together on that.
              >>
              >> Hers my situation...
              >> We have an application written in C++(I was using vb6 as a test, still
              >> the best test language in the Universe)
              >> that allows for users to create plugins. The plug-in architect has both
              >> code only and UI interfaces. Both are
              >> needed to create a sucessfull plugin. This is done in VB6 by creating a
              >> user control. The ctl is used to interface with the plug-in UI and then
              >> in VB6 another class is added which communicates to the Plug-in code only
              >> interface. The 2 work in concert. Works beautifully
              >> How can I do this with .Net?
              >>
              >> Is this at all possible. We have many useres world wide who would like to
              >> create plug-in's using .Net.
              >> Can something be done on the C++ app to handles this?
              >>
              >> Thanks for your help and expertise.
              >>
              >> -Lou
              >>
              >>
              >> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
              >> news:OWo79MUlGH A.3740@TK2MSFTN GP02.phx.gbl...[color=darkred]
              >>> "Lou" <lou.garvin@com cast.net> schrieb:
              >>>> Its a user control that I want the form to show up in VB6
              >>>> I did check the "Register for COM interop" box and that was very
              >>>> helpfull but I don't get the form to show up in VB6
              >>>>
              >>>> VB6 code
              >>>> Dim x As New UserControl1
              >>> As I already said, this is not supported!
              >>>
              >>> --
              >>> M S Herfried K. Wagner
              >>> M V P <URL:http://dotnet.mvps.org/>
              >>> V B <URL:http://classicvb.org/petition/>[/color]
              >>
              >>[/color]
              >
              > I have done stuff like this before. You can only show forms created in
              > .Net, you cannot place a "user control" on the VB6 application. For
              > example, we have a scanner interface that we developed in VB.Net and
              > created a COM interop assembly. In this assembly we have a form that will
              > popup and the user can select the source, scan an image, save it, view it,
              > etc. This is all controlled through the assembly. You can then create
              > methods and properties to communicate the data back to the VB6
              > application. Just remember, it will show up as a separate form and not
              > embedded on the VB6 forms.[/color]


              Comment

              • CodeMonkey

                #8
                Re: User Control

                Lou, if this has to be a .Net UserControl and has to be displayed
                embedded on a VB6 form, you cannot do this, no matter how hard you try.
                It is just not supported at all. There isn't even a work around. You can
                call code from a COM aware .Net assembly, but you cannot host .Net
                UserControls on the VB6 forms. If you absolutely have to do this, then
                convert your VB6 app to .Net.

                Lou wrote:[color=blue]
                > Since this is a plug-n it needs to be hosted within the C++ app and cannot
                > be a seperate or pop up form.
                > it needs to live in a special place in the C++ app.
                >
                > "CodeMonkey " <spammers@suck. com> wrote in message
                > news:sGemg.6996 1$4L1.3684@news svr11.news.prod igy.com...[color=green]
                >> Lou wrote:[color=darkred]
                >>> Sorry about that, I didn't put 2 and 2 together on that.
                >>>
                >>> Hers my situation...
                >>> We have an application written in C++(I was using vb6 as a test, still
                >>> the best test language in the Universe)
                >>> that allows for users to create plugins. The plug-in architect has both
                >>> code only and UI interfaces. Both are
                >>> needed to create a sucessfull plugin. This is done in VB6 by creating a
                >>> user control. The ctl is used to interface with the plug-in UI and then
                >>> in VB6 another class is added which communicates to the Plug-in code only
                >>> interface. The 2 work in concert. Works beautifully
                >>> How can I do this with .Net?
                >>>
                >>> Is this at all possible. We have many useres world wide who would like to
                >>> create plug-in's using .Net.
                >>> Can something be done on the C++ app to handles this?
                >>>
                >>> Thanks for your help and expertise.
                >>>
                >>> -Lou
                >>>
                >>>
                >>> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                >>> news:OWo79MUlGH A.3740@TK2MSFTN GP02.phx.gbl...
                >>>> "Lou" <lou.garvin@com cast.net> schrieb:
                >>>>> Its a user control that I want the form to show up in VB6
                >>>>> I did check the "Register for COM interop" box and that was very
                >>>>> helpfull but I don't get the form to show up in VB6
                >>>>>
                >>>>> VB6 code
                >>>>> Dim x As New UserControl1
                >>>> As I already said, this is not supported!
                >>>>
                >>>> --
                >>>> M S Herfried K. Wagner
                >>>> M V P <URL:http://dotnet.mvps.org/>
                >>>> V B <URL:http://classicvb.org/petition/>
                >>>[/color]
                >> I have done stuff like this before. You can only show forms created in
                >> .Net, you cannot place a "user control" on the VB6 application. For
                >> example, we have a scanner interface that we developed in VB.Net and
                >> created a COM interop assembly. In this assembly we have a form that will
                >> popup and the user can select the source, scan an image, save it, view it,
                >> etc. This is all controlled through the assembly. You can then create
                >> methods and properties to communicate the data back to the VB6
                >> application. Just remember, it will show up as a separate form and not
                >> embedded on the VB6 forms.[/color]
                >
                >[/color]

                Comment

                • Herfried K. Wagner [MVP]

                  #9
                  Re: User Control

                  "CodeMonkey " <spammers@suck. com> schrieb:[color=blue]
                  > Lou, if this has to be a .Net UserControl and has to be displayed embedded
                  > on a VB6 form, you cannot do this, no matter how hard you try. It is just
                  > not supported at all. There isn't even a work around.[/color]

                  There are workarounds available
                  (<URL:http://www.codeproject .com/cs/miscctrl/exposingdotnetc ontrols.asp>)
                  but this doesn't make it a supported scenario.

                  --
                  M S Herfried K. Wagner
                  M V P <URL:http://dotnet.mvps.org/>
                  V B <URL:http://classicvb.org/petition/>

                  Comment

                  Working...