Hi Jerry,
Sorry for late reply.
I have reviewed all your posts about COM interop. It seems your objective
is to be able to use the Logging class both in .NET client and COM client.
Since you have the source code, I think you may not have to create a
wrapper for it. Why not make the data types used in the class compatible
for both types of clients? I mean, previously I suggested to create a
wrapper class because you mentioned that some data types are not
recogonized by VB6. However, a wrapper class works best when you only need
to expose some static/shared functions or you don't have the source code of
the original class.
Regarding the ComSourceInterfaces attribute, you're right it's used to
expose events to COM client, we have a How-To in MSDN library:
#How to: Raise Events Handled by a COM Sink
http://msdn2.microsoft.com/en-us/library/dd8bf0x3.aspx
By the way, your several posts about COM interop seems a bit scattered and
I'm not sure about some posts' status. Would you please summarize all the
blocking issues you're having now and post them here, so that we can focus
in one thread and have better context to reference. Thanks.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
JerryWEC - 26 Jan 2007 15:05 GMT
Walter,
There is basically what I was originally trying to do or accomplish...
Objective: Inherit from my base class called logging and create my new class
called ComLogging (COM Wrapper).
I have found two good web pages that explain how COM Interop works and why
it works that way it does. So I'm a lot smarter now.
Basically, I was planning to inherit from my base class and leave it along
(works for .net clients) and then in the derived class (Com Wrapper) I could
modify my properies, subs/functions, and events to work with VB6 (COM).
I have still thinking along those lines, but I have changes three of my
public properties in the base class from .net Long datatypes to .net
Integers (long in VB6). One of my event have a .net exception object (which
VB6 can't understand). So I was planning on overriding my properties,
methods, and events in the derived class (COM wrapper) to make them work
with VB6.
One of the two good web pages told me how to do COM interop (the preferred
way) and not the canned out of the box way that the COM templete provides.
I'll start a new post after I play with this some more.
Thanks! JerryM