Warning when using built-in Interop types

I recently upgraded one of my C # solutions from VS2008 to vs 2010 to use the built-in interop type function so that I can stop delivering the interops library that we currently need due to interaction with our old VB6 code base.

For some reason, I get the following message when I compile my solution:

The importer of the type library met an interface not obtained from IUnknown: '_HiddenInterface'

I searched around, and so far only two bits of information that I could find were โ€œjust ignoring this, it does no harmโ€, and โ€œthat means the VB6 code breaks some rules.โ€ Since the VB codebase is ours, and it is preferable to have 0 warnings when compiling, I would like to fix everything that causes these warnings.

I'm at a loss, so any advice would be great.

+4
source share
1 answer

You will get a compiler warning if you have a link to a COM library that contains a public method that returns a VB collection object.

The _HiddenInterface interface is contained in the MSVBVM60.DLL file. You can see this by opening OLE View and going to Type Libraries > Visual Basic for Applications (version 6.0) . Double-click the typelib icon to open the ITypeLib viewer. You can see interface _HiddenInterface in the list.

You should be able to consume the collections returned by these functions, although you cannot create an instance of one in .NET, as described in Microsoft KB BUG: Error Message When You Try to Transfer a Collection Object from Visual Basic 6.0 Components to Visual Basic 2005 or Visual Basic .NET: "System.InvalidCastException" .

+2
source

All Articles