Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does not implement interface member Error

Here's my code, VS2012 C# Express is complaining about the non implementation of the two members in the interface PISDK._DEventPipeEvents, which is pasted here quickly:

    namespace PISDK
{
    [Guid("9E679FD2-DE8C-11D3-853F-00C04F45D1DA")]
    [InterfaceType(2)]
    [TypeLibType(4096)]
    public interface _DEventPipeEvents
    {
        [DispId(2)]
        void OnNewValue();
        [DispId(1)]
        void OnOverflow(object vtEvent, OverflowCauseConstants Cause);
    }
}

and here's my code:

class PointListEventPipeEventReceiver : PISDK._DEventPipeEvents
{
    private PISDK.EventPipe eventPipe;

    public PointListEventPipeEventReceiver(PISDK.EventPipe eventPipe)
    {
        this.eventPipe = eventPipe;
    }

    public void PISDK._DEventPipeEvents.OnNewValue()
    {
        Console.WriteLine("New value event");
        handleNewValue(eventPipe);
    }

    public void PISDK._DEventPipeEvents.OnOverFlow(object vtEvent, PISDK.OverflowCauseConstants Cause)
    {
        throw new NotImplementedException();
    }

    private void handleNewValue(PISDK.EventPipe eventPipe)
    {
        Console.WriteLine("Handling new value");
        Array eventObjs = eventPipe.TakeAll();
        Console.WriteLine("eventObjs.Length==" + eventObjs.Length);
        foreach (PISDK.PIEventObject piEventObj in eventObjs)
        {
            Console.WriteLine(piEventObj.EventData as PISDK.PointValue);
        }
    }
}

I'm at a loss here, any help is nice.

like image 741
cdietschrun Avatar asked Jul 07 '26 03:07

cdietschrun


1 Answers

Your implementation uses OnOverFlow with a capital F instead of a lowercase one in the interface. The method should be called OnOverflow.

like image 96
Sergey Kalinichenko Avatar answered Jul 10 '26 14:07

Sergey Kalinichenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!