G
Gagan
I have a third-party COM library which has objects that supports
aggregation. By aggregation I mean what is mentioned here at this MSDN
link:
http://msdn2.microsoft.com/en-us/li...cpconinheritanceaggregationcontainmentanchor2
Till now I have been developing in C++ to aggregate objects form that
third-party library so that I could customize their behavior without
having to implement all the interfaces that object implements. But now
we are porting our code to C# and we need to crack this 'how to
implement COM style aggregation in C#" nut.
It is clear to me that I need to use COM interop services - by
referencing the COM library in my C# project which will create a
wrapper assembly. Also I need to implement the interface of the COM
object that I am aggregating in my .NET object - much the same as I do
in C++. But I am utterly clueless as to how to do the aggregation
magic that is performed by C++ ATL macro
COM_INTERFACE_ENTRY_AGGREGATE_BLIND.
Has anyone done this before? I will really really appreciate if
someone can share a piece of sample code.
Thanks!
aggregation. By aggregation I mean what is mentioned here at this MSDN
link:
http://msdn2.microsoft.com/en-us/li...cpconinheritanceaggregationcontainmentanchor2
Till now I have been developing in C++ to aggregate objects form that
third-party library so that I could customize their behavior without
having to implement all the interfaces that object implements. But now
we are porting our code to C# and we need to crack this 'how to
implement COM style aggregation in C#" nut.
It is clear to me that I need to use COM interop services - by
referencing the COM library in my C# project which will create a
wrapper assembly. Also I need to implement the interface of the COM
object that I am aggregating in my .NET object - much the same as I do
in C++. But I am utterly clueless as to how to do the aggregation
magic that is performed by C++ ATL macro
COM_INTERFACE_ENTRY_AGGREGATE_BLIND.
aggregation is not only possible in .NET, but it is actually easier.From the MSDN documentation and newsgroups I get the idea that
Has anyone done this before? I will really really appreciate if
someone can share a piece of sample code.
Thanks!