473,473 Members | 1,477 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Nov 17 '05 #1
2 2610
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 "collections" 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" <bj****@hotmail.com> wrote in message
news:u6****************@tk2msftngp13.phx.gbl...
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

Nov 17 '05 #2
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]" <ni*******@hotmail.nospam.com> wrote in message
news:Y7********************@comcast.com...
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 "collections" 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" <bj****@hotmail.com> wrote in message
news:u6****************@tk2msftngp13.phx.gbl...
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


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nice Chap | last post by:
Aggregation in COM was defined as 'Exposing an interface of an inner object by the outer object as though it were an interface of the outer object'. Is this type of aggregation possible in c#? ...
5
by: John Wood | last post by:
Let's say you're provided with an instance of a class. The instantiation takes place in another module that you have no control over. However, you've extended that class with your own value-added...
4
by: cmrchs | last post by:
Hi, how do I implement aggregation and how composition in C# ? When I say : an Airplane has a Pilot then I use aggregation but when I say : an Airplane has a Cockpit then I use composition. How...
4
by: Frederik Vanderhaegen | last post by:
Hi, Can anyone explain me the difference between aggregation and composition? I know that they both are "whole-part" relationships and that composition parts are destroyed when the composition...
23
by: SenthilVel | last post by:
Hi Can any one let me know the websites/Pdf for learning Aggragation in C#?? Thanks Senthil
1
by: ninjutsu28 | last post by:
hi im juz a student so pls bear with my terminologies..juz wana ask how to perform aggregation in vb.net code.. in my model, i have rectangle, shape, drawing classes..rectangle class inherits...
7
by: Bruce One | last post by:
In C#, how would people implement a relationship between Customer class and Request class, considering a customer may have 0-n requests and a request must belong to 1 and only 1 customer...? ...
0
by: Karigar | last post by:
I have been so far developing COM servers and clients in C++. I am new to C#/NET way of doing COM and was wondering if it is possible to accomplish aggregation in .NET platform. By aggregation I...
6
by: Jeff | last post by:
hey Can OO Aggregation be described as: - A system of objects that are built using each other any comments? Jeff
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.