COM Interop - Interface Questions



Hey guys,

I'm trying to get Com Interop to work for my class library I have wrote. It
works fairly good for .net clients as is. So now I'm trying to add a COM
Wrapper for it to expose it to a VB6 client. I have discover the best way
to do this is to use the following attribute and an Interface to my base
class. This exposes my base class methods, properties and events to my
COM/VB6 client application.

<ClassInterface(ClassInterfaceType.None)> _

I have to use this because most of my code is in the base class called
Logging and I don't want to rewrite it again for COM so I'm figuring I can
use Inheritance and modify (override) the methods that need changed for VB6.
I'll override these methods in the ComLogging wrapper class I'm exposing to
the COM world.

One question I have is can I create one Interface called IStandardLogging
for my methods in the base class that are not changing and have another
Interface called IComLogging to expose my modified methods? I'm thinking I
can use the following ComSourceInterfaces() attribute to create the required
interface methods in the .tlb type library for VB6?

<ComSourceInterfaces(GetType(ILogging), GetType(IComLogging))> _

Another question I have is how do you expose the events in COM using the
above method suggested? Do you do them like the other Sub/Functions? Or, is
there more to it?

TIA! JerryM


.