Vb uses the class module name as an alias for the default interface; that is, the Vb compiler maps the class name to the default interface reference silently for you. For detailed instructions regarding the mapping, please see the related document listed on the "References" section.
While the transparent mapping works well on Vb, the Object Browser could interpret the COM type library incorrectly at the implemented interface happens to be the default 1. All default interface references are displayed as their corresponding CoClass names instead, because Vb uses the CoClass name as an alias for the default interface reference to access it. For a type library from the bellowing IDL document, the Object Browser cannot see the default interface IClass2:
library myTypeLib
{
// Forward declare all types defined on the typelib
interface IClass1;
interface IClass2;
interface IClass1 : IDispatch {
[id(0x00000000)]
HRESULT method1([out, retval] IClass2** pVal);
};
interface IClass2 : IDispatch {
[id(0x00000000)]
HRESULT method2([out, retval] BSTR* pVal);
};
coclass Class1 {
[default] interface IClass1;
};
coclass Class2 {
[default] interface IClass2;
};
};
Class1's (actually interface IClass1's) method1 returns Class2 (actually IClass2 reference) instead of IClass2. the behavior occurs because Vb uses the Class2 as an alias for the default interface IClass2.
In addition, at multiple CoClass implement the same interface as a default 1, the Object Browser uses the first occurring CoClass name for any reference to the default interface. the was by design.