COM and Remoting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rogério Manente

    #1

    COM and Remoting

    I am having the following problem using 1.1 Framwork. I would like to know
    it anyone had the same problem and if moving to 2.0 Framework solves the
    problem!

    I have a class A which uses a COM component (third party, so it can't be
    changed). This A class comunicates with another another class, B. This is a
    bi-directional comunication (B calls a method of A which, then, calls a
    method of the COM component).
    Everything works fine until I the comunication between A and B is done
    through remoting.

    When B resides in an application server the comunication between A and B
    works fine but when B calls a method of the COM component the system hangs.
    I have no idea of why this happens!

    Thank you!

    Rogério Manente
    manente@gmail.c om


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: COM and Remoting

    Rogerio,

    My initial guess is that the object is an STA object, meaning that calls
    have to be marshaled correctly in the apartment it was created on. In
    remoting, that most likely is not going to be the case.

    In this case, I would recommend that you actually set up a thread
    specifically for this component to run in. You would create it there, and
    send messages to it (you should be running a message pump on an STA thread,
    so you can do that).

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Rogério Manente" <manente@gmail. com> wrote in message
    news:Oqb4$hiCGH A.2644@TK2MSFTN GP09.phx.gbl...[color=blue]
    >I am having the following problem using 1.1 Framwork. I would like to know
    >it anyone had the same problem and if moving to 2.0 Framework solves the
    >problem!
    >
    > I have a class A which uses a COM component (third party, so it can't be
    > changed). This A class comunicates with another another class, B. This is
    > a
    > bi-directional comunication (B calls a method of A which, then, calls a
    > method of the COM component).
    > Everything works fine until I the comunication between A and B is done
    > through remoting.
    >
    > When B resides in an application server the comunication between A and B
    > works fine but when B calls a method of the COM component the system
    > hangs.
    > I have no idea of why this happens!
    >
    > Thank you!
    >
    > Rogério Manente
    > manente@gmail.c om
    >
    >[/color]


    Comment

    • Willy Denoyette [MVP]

      #3
      Re: COM and Remoting


      "Rogério Manente" <manente@gmail. com> wrote in message
      news:Oqb4$hiCGH A.2644@TK2MSFTN GP09.phx.gbl...[color=blue]
      >I am having the following problem using 1.1 Framwork. I would like to know
      >it anyone had the same problem and if moving to 2.0 Framework solves the
      >problem!
      >
      > I have a class A which uses a COM component (third party, so it can't be
      > changed). This A class comunicates with another another class, B. This is
      > a
      > bi-directional comunication (B calls a method of A which, then, calls a
      > method of the COM component).
      > Everything works fine until I the comunication between A and B is done
      > through remoting.
      >
      > When B resides in an application server the comunication between A and B
      > works fine but when B calls a method of the COM component the system
      > hangs.
      > I have no idea of why this happens!
      >
      > Thank you!
      >
      > Rogério Manente
      > manente@gmail.c om
      >
      >[/color]

      What kind of COM component is this? What are it's threading requirements
      (STA/Free threaded...) and what are it's hosting requirements?. Is it
      designed to run in a server context (note ActiveX components aren't!)

      Willy.



      Comment

      • Rogério Manente

        #4
        Re: COM and Remoting

        Thanks for you help Nicholas!
        Just to see if I understood your sugestion right, I whould create a thread
        in object A just for the COM component?
        Do you know where I can find more informantion about that (a link to some
        resource on the web?)

        Thanks again!

        Rogério Manente


        "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c om> escreveu
        na mensagem news:uQOWI0iCGH A.1124@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Rogerio,
        >
        > My initial guess is that the object is an STA object, meaning that
        > calls have to be marshaled correctly in the apartment it was created on.
        > In remoting, that most likely is not going to be the case.
        >
        > In this case, I would recommend that you actually set up a thread
        > specifically for this component to run in. You would create it there, and
        > send messages to it (you should be running a message pump on an STA
        > thread, so you can do that).
        >
        > Hope this helps.
        >
        >
        > --
        > - Nicholas Paldino [.NET/C# MVP]
        > - mvp@spam.guard. caspershouse.co m
        >
        > "Rogério Manente" <manente@gmail. com> wrote in message
        > news:Oqb4$hiCGH A.2644@TK2MSFTN GP09.phx.gbl...[color=green]
        >>I am having the following problem using 1.1 Framwork. I would like to know
        >>it anyone had the same problem and if moving to 2.0 Framework solves the
        >>problem!
        >>
        >> I have a class A which uses a COM component (third party, so it can't be
        >> changed). This A class comunicates with another another class, B. This is
        >> a
        >> bi-directional comunication (B calls a method of A which, then, calls a
        >> method of the COM component).
        >> Everything works fine until I the comunication between A and B is done
        >> through remoting.
        >>
        >> When B resides in an application server the comunication between A and B
        >> works fine but when B calls a method of the COM component the system
        >> hangs.
        >> I have no idea of why this happens!
        >>
        >> Thank you!
        >>
        >> Rogério Manente
        >> manente@gmail.c om
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...