COM Interop

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

    COM Interop

    I am trying to write an application in vb .net. I am
    using two COM objects, the WebBrowser Control and another
    object written by an associate. The second object has a
    method which takes a pointer to a WebBrowser object as a
    parameter. I don't know of a way to get a pointer to the
    actual WebBrowser control rather than the wrapper. This
    seems like it would be something that a lot of people
    would need to do, so please let me know if you know of a
    solution.
  • Scott M.

    #2
    Re: COM Interop

    You need the wrapper to wrap the COM object in .NET clothing. This is how
    interOp works.


    "joe" <joe@joe.com> wrote in message
    news:036d01c37b af$53a87cb0$a10 1280a@phx.gbl.. .[color=blue]
    > I am trying to write an application in vb .net. I am
    > using two COM objects, the WebBrowser Control and another
    > object written by an associate. The second object has a
    > method which takes a pointer to a WebBrowser object as a
    > parameter. I don't know of a way to get a pointer to the
    > actual WebBrowser control rather than the wrapper. This
    > seems like it would be something that a lot of people
    > would need to do, so please let me know if you know of a
    > solution.[/color]


    Comment

    • joe

      #3
      Re: COM Interop

      Are you saying that what I want to do is impossible? It
      would seem that this would greatly inhibit
      interoperabilit y. How would you suggest I solve my
      problem? Thanks for the response.
      [color=blue]
      >-----Original Message-----
      >You need the wrapper to wrap the COM object in .NET[/color]
      clothing. This is how[color=blue]
      >interOp works.
      >
      >
      >"joe" <joe@joe.com> wrote in message
      >news:036d01c37 baf$53a87cb0$a1 01280a@phx.gbl. ..[color=green]
      >> I am trying to write an application in vb .net. I am
      >> using two COM objects, the WebBrowser Control and[/color][/color]
      another[color=blue][color=green]
      >> object written by an associate. The second object has[/color][/color]
      a[color=blue][color=green]
      >> method which takes a pointer to a WebBrowser object as[/color][/color]
      a[color=blue][color=green]
      >> parameter. I don't know of a way to get a pointer to[/color][/color]
      the[color=blue][color=green]
      >> actual WebBrowser control rather than the wrapper.[/color][/color]
      This[color=blue][color=green]
      >> seems like it would be something that a lot of people
      >> would need to do, so please let me know if you know of[/color][/color]
      a[color=blue][color=green]
      >> solution.[/color]
      >
      >
      >.
      >[/color]

      Comment

      • Scott M.

        #4
        Re: COM Interop

        Well, I want to be sure I understand your question before I say "no".

        When you need to utilize any COM object in the .NET world, you MUST make a
        reference to the COM object, which, in turn, creates a wrapper class so that
        the COM object can impersonate a .NET object.

        If you are asking if there is a way to not do that and still use the COM
        object, the answer is no. There is a price to pay for InterOp (the wrapper
        class), and that can sometimes even cause a degradation in performance
        (usually not, but in some circumstances it can). But, there is no other way
        to get COM and .NET to talk to each other since they stem from completely
        different architectures.


        "joe" <joe@joe.com> wrote in message
        news:368601c37b b3$73ac25d0$a50 1280a@phx.gbl.. .[color=blue]
        > Are you saying that what I want to do is impossible? It
        > would seem that this would greatly inhibit
        > interoperabilit y. How would you suggest I solve my
        > problem? Thanks for the response.
        >[color=green]
        > >-----Original Message-----
        > >You need the wrapper to wrap the COM object in .NET[/color]
        > clothing. This is how[color=green]
        > >interOp works.
        > >
        > >
        > >"joe" <joe@joe.com> wrote in message
        > >news:036d01c37 baf$53a87cb0$a1 01280a@phx.gbl. ..[color=darkred]
        > >> I am trying to write an application in vb .net. I am
        > >> using two COM objects, the WebBrowser Control and[/color][/color]
        > another[color=green][color=darkred]
        > >> object written by an associate. The second object has[/color][/color]
        > a[color=green][color=darkred]
        > >> method which takes a pointer to a WebBrowser object as[/color][/color]
        > a[color=green][color=darkred]
        > >> parameter. I don't know of a way to get a pointer to[/color][/color]
        > the[color=green][color=darkred]
        > >> actual WebBrowser control rather than the wrapper.[/color][/color]
        > This[color=green][color=darkred]
        > >> seems like it would be something that a lot of people
        > >> would need to do, so please let me know if you know of[/color][/color]
        > a[color=green][color=darkred]
        > >> solution.[/color]
        > >
        > >
        > >.
        > >[/color][/color]


        Comment

        Working...