This post originated from an RSS feed registered with .NET Buzz
by Sam Gentile.
Original Post: COM Interop with Whidbey Generics?
Feed Title: Sam Gentile's Blog
Feed URL: http://samgentile.com/blog/Rss.aspx
Feed Description: .NET and Software Development from an experienced perspective - .NET/CLR, Rotor, Interop, MC+/C++, COM+, ES, Mac OS X, Extreme Programming and More!
This is freaky stuff-) I have been doing some experimenting while putting together my Advanced COM Interop talk for VSLive! today. Of course it can't be possible for the Type Library Exporter to export a Generic Type to a COM type since there is no concrete type. It doesn't make sense. I wanted to see what happens anyhow in ILDASM. What about if I use a Generic Interface and then instantiate a class implementing the generic interface with a concrete type such as double? That should export and it does. BTW, I am using the evil ClassInterface.AutoDual instead of the correct way to export with the ClassInterface.None as it doesn't export with the interface. It looks like the Type Library Exporter is doing the right thing. It skips the generic interface and keeps going as there could be (and are) other types. TLBEXP gives a warning: