[quoted text, click to view] "Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:uMxQbA9bDHA.2820@tk2msftngp13.phx.gbl...
> Joshua,
>
> >Public Property Set StationMonitor(smonNew As clsStationMonitor)
> > Set smonCurrent = smonNew
> >End Property
> >
> >
> >Note that "clsStationMonitor" is the class that is being implemented in
the
> >new C# dll ("this").
>
> Is the clsStationMonitor class interface originally defined in a VB6
> DLL that you have TlbImp'ed to get access to in the C# code, or do you
> have duplicate definitions of the interface?
That class was originally defined in a COM VB6 based dll. We are attempting
to write a replacement for this dll in C# .NET. I'd like the .NET version
to look /exactly/ the same as the COM VB6 version of the dll to existing COM
based consumers. Ideally, I'd like the C# .NET version to be a drop-in
replacement for the dll without modifying and recompiling all the older
modules that used it.
I neglected to include that I have added the following to the C# version to
attempt to make it look the same to COM:
//COM event interface
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
public interface _clsStationMonitor_Events
{
....
}
//COM class interface
[GuidAttribute("4E6CBC6E-6FD8-4F7D-AC69-486C9DA6D974")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
public interface _clsStationMonitor
{
....
}
[ClassInterface(ClassInterfaceType.None)]
[ComSourceInterfaces(typeof(_clsStationMonitor_Events))]
public class clsStationMonitor : _clsStationMonitor
{
....
}
It seems that VB6 is not recognizing the new C# dll class as the same class
as the older COM based one -- thus the type mismatch.
[quoted text, click to view] >
> Does it make a difference if you make the smonNew parameter ByVal?
>
I can't really do this because this module can not be modified (it
implements an established interface that we can't change now).
[quoted text, click to view] >
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
>
http://www.msjogren.net/dotnet/ > Please reply only to the newsgroup.
Thanks
---
- Joshua B. Helm
Technology Manager
Millbrook Incorporated