Hi Jekke,

The VB.NET toolset can be a rather dodgy when it comes to namespace/class
resolution. You wouldn't perchance be placing your VB classes in a namespace
starting with 'GroupOne'?

This case shows that VB.NET isn't trying hard enough to find the class
you're referencing.

Whenever I hit situations like this, I find that declaring a namespace alias
forces the compiler to behave. Try this:

Imports Interfaces = GroupOne.TradingTools.Interfaces

Namespace GroupOne.AnythingElse
    Public Class VBClient
        Implements Interfaces.IMarketDataStreamer


        Public ReadOnly Property QuoteManager() As Interfaces.EventManager
Implements Interfaces.IMarketDataStreamer.QuoteManager
            Get

            End Get
        End Property

        Public Property QuoteThreadPriority() As
System.Threading.ThreadPriority Implements
Interfaces.IMarketDataStreamer.QuoteThreadPriority
            Get

            End Get
            Set(ByVal Value As System.Threading.ThreadPriority)

            End Set
        End Property

        Public Sub StartStreaming() Implements
Interfaces.IMarketDataStreamer.StartStreaming

        End Sub

        Public Sub StopStreaming() Implements
Interfaces.IMarketDataStreamer.StopStreaming

        End Sub

        Public Sub TerminateSession() Implements
Interfaces.IMarketDataStreamer.TerminateSession

        End Sub

        Public ReadOnly Property TradeManager() As Interfaces.EventManager
Implements Interfaces.IMarketDataStreamer.TradeManager
            Get

            End Get
        End Property

        Public Property TradeThreadPriority() As
System.Threading.ThreadPriority Implements
Interfaces.IMarketDataStreamer.TradeThreadPriority
            Get

            End Get
            Set(ByVal Value As System.Threading.ThreadPriority)

            End Set
        End Property
    End Class
End Namespace

> -----Original Message-----
> From: Unmoderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of Jekke Bladt
> Sent: Saturday, 18 December 2004 5:32 AM
> To: [email protected]
> Subject: [ADVANCED-DOTNET] Implementing a C# interface in VB.net
>
> All--
>
> I've got a weird error coming up based on the following interface:
>
> public interface IMarketDataStreamer
> {
>         void StartStreaming();
>         void StopStreaming();
>         void TerminateSession();
>         EventManager TradeManager { get; }
>         EventManager QuoteManager { get; }
>         ThreadPriority QuoteThreadPriority { get; set; }
>         ThreadPriority TradeThreadPriority { get; set; } }
>
> When I auto-generate the implementation skeleton in VB.net, I
> get something like this (stuff snipped for clarity):
>
> Public Class BogusStreamer
>     Implements IMarketDataStreamer
>
>     Public ReadOnly Property QuoteManager() As EventManager
> Implements
> GroupOne.TradingTools.Interfaces.IMarketDataStreamer.QuoteManager
>         Get
>
>         End Get
>     End Property
>
>     Public ReadOnly Property TradeManager() As EventManager
> Implements
> GroupOne.TradingTools.Interfaces.IMarketDataStreamer.TradeManager
>         Get
>
>         End Get
>     End Property
>
> End Class
>
> Both of the methods above give me a compiler error along the
> lines of
> "C:\ISEPerforce\GroupOne.CentralClassLibrary\GroupOne.CentralC
lassLibrar
> y.TheKitchenSink\BogusStreamer.vb(34): 'TradeManager' cannot
> implement 'TradeManager' because there is no matching
> property on interface 'IMarketDataStreamer'."
>
> I've checked to make sure there are no ambiguous references
> and get this message even if I explicitly spell out the type
> of EventManager in both signatures and even after I've
> provided a return value.
>
> What am I doing wrong?
>
> TIA
>
> --Jekke
>
> ===================================
> This list is hosted by DevelopMentor.  http://www.develop.com
> Some .NET courses you may be interested in:
>
> Essential .NET: building applications and components with C#
> November 29 - December 3, in Los Angeles
> http://www.develop.com/courses/edotnet
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor�  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to