I created a C# library that uses existing COM types and expose some functions via COM.
I added the reference to the existing TypeLib from the Reference Manager in Visual Studio 2013. It automatically creates the interop assembly and embed interop types.
Some of my exposed COM functions have parameters whose types coming from the interop assembly.
Then I register my assembly with the regasm tool (and the /codebase /tlb options).
Problem: the parameters with interop types become IUnknown interfaces!
Here is the warning that regasm show to me:
Warning: Type library exporter could not find the type library for 'Foo.Bar'. IUnknown was substituted for the interface.
For example, my exported function looks like:
MyFunction(IUnknown bar);
Instead of:
MyFunction(Bar bar);
What I am doing false?
EDIT: I have tested with IBar
instead of Bar
, but that changes nothing.