0
votes

I remember seeing a question on my official MS 70-536 exam that talked about a simple class that was designed to be exposed for COM calling clients and etc. of all the members defined in the classes I chose the answer D. The one that used a generic.

My question to you guys is this:

If you were designing a .Net custom type that was to be eventually consumed by a COM caller or a COM type... of all the guidelines I have read on this subject, generics is the one .Net topic I would not include in a class for this purpose I would omit such a data member or use something else?

Am I right in thinking this. As soon as I saw this question I knew it was generics but I can't seem to prove it. Surely I did not make this up ... generics is a .net feature right?

1

1 Answers

5
votes

COM interop cannot work directly with generics. MSDN:

http://msdn.microsoft.com/en-us/library/ms229590(v=VS.80).aspx

Generics is a .Net feature that COM does not have a concept for, so there can't easily be any interop\marshalling glue to make up for this fact.