aggregation in C#

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

    aggregation in C#

    Hi,

    I would like to implement aggregation in C#, therefore I'd need to implement
    the queryinterface COM function of a class. I am not sure whether this can
    be done, and if yes where to start. If someone has an example, a hint or
    anything that might help, please share it with me.

    Thanks and Regards,
    Jozsi


  • Nick Malik [Microsoft]

    #2
    Re: aggregation in C#

    Why do you need to implement a COM interface to do aggregation?

    Strict aggregation simply requires the declaration of a public or private
    member variable.

    If you mean "collection s" then there is a set of collection classes
    available already. No need to call COM for that.

    On the other hand, if you have a need for a COM app to call your .Net app,
    google on ".net COM Interop"

    --
    --- Nick Malik [Microsoft]
    MCSD, CFPS, Certified Scrummaster


    Disclaimer: Opinions expressed in this forum are my own, and not
    representative of my employer.
    I do not answer questions on behalf of my employer. I'm just a
    programmer helping programmers.
    --
    "Jozsef Bekes" <bjdodo@hotmail .com> wrote in message
    news:u6o%239EgY FHA.4036@tk2msf tngp13.phx.gbl. ..[color=blue]
    > Hi,
    >
    > I would like to implement aggregation in C#, therefore I'd need to
    > implement the queryinterface COM function of a class. I am not sure
    > whether this can be done, and if yes where to start. If someone has an
    > example, a hint or anything that might help, please share it with me.
    >
    > Thanks and Regards,
    > Jozsi
    >[/color]


    Comment

    • Jozsef Bekes

      #3
      Re: aggregation in C#

      Hi Nick,

      thank you for your answer. Actually I need to rewrite an app in C# that was
      written in VB6 and VC++. I need to support old clients connecting to my
      converted app via COM, and new clients connecting via .net. The old
      architecture (that I am not supposed to change) involves aggregation.
      The only way to supoort old clients seems to me to change aggregation to
      containment, in other words to derive from the aggregated IF as well, and
      implement all the functions in a way that they just forward the call to the
      member, however this seems a bit stupid. It does for sure, I have
      implemented it :-). If you have a better suggestion, please let me know.

      Regards,
      Jozsi



      "Nick Malik [Microsoft]" <nickmalik@hotm ail.nospam.com> wrote in message
      news:Y7KdnRXINs n1ogrfRVn-pg@comcast.com. ..[color=blue]
      > Why do you need to implement a COM interface to do aggregation?
      >
      > Strict aggregation simply requires the declaration of a public or private
      > member variable.
      >
      > If you mean "collection s" then there is a set of collection classes
      > available already. No need to call COM for that.
      >
      > On the other hand, if you have a need for a COM app to call your .Net app,
      > google on ".net COM Interop"
      >
      > --
      > --- Nick Malik [Microsoft]
      > MCSD, CFPS, Certified Scrummaster
      > http://blogs.msdn.com/nickmalik
      >
      > Disclaimer: Opinions expressed in this forum are my own, and not
      > representative of my employer.
      > I do not answer questions on behalf of my employer. I'm just a
      > programmer helping programmers.
      > --
      > "Jozsef Bekes" <bjdodo@hotmail .com> wrote in message
      > news:u6o%239EgY FHA.4036@tk2msf tngp13.phx.gbl. ..[color=green]
      >> Hi,
      >>
      >> I would like to implement aggregation in C#, therefore I'd need to
      >> implement the queryinterface COM function of a class. I am not sure
      >> whether this can be done, and if yes where to start. If someone has an
      >> example, a hint or anything that might help, please share it with me.
      >>
      >> Thanks and Regards,
      >> Jozsi
      >>[/color]
      >
      >[/color]


      Comment

      Working...