0

Hi,

I get an error when trying to compile a class that I have created: "EWrapperImpl.cs"
Error: TestCsharp.EWrapperImpl' does not implement interface member 'IBApi.EWrapper.currentTime(long)

It is documented in an example that: "you need to provide at least an empty shell of the method declared in EWrapper"
but I don't know how to do this. I wonder if it is a basic delaration that can be done in EWrapper ?

    namespace TestCsharp
    {
        public class EWrapperImpl : EWrapper
        {

            EClientSocket clientSocket;

            private int nextOrderId;

            public EWrapperImpl()
            {
                clientSocket = new EClientSocket(this);
            }

            public EClientSocket ClientSocket
            {
                get { return clientSocket; }
                set { clientSocket = value; }
            }


        }
    }

Edited by Darth Vader

4
Contributors
3
Replies
17
Views
2 Years
Discussion Span
Last Post by sandeepjkl
0

Can you show us EWapper? Is that an interface? If so click on it above and hit Ctrl period.

If it is an interface, then its a convention to name then with an I - eg IEwrapper

Edited by DaveAmour

1

You're writing a class that implements an interface:

public class EWrapperImpl : EWrapper

This means your EWrapperImpl class must have methods that match everything in EWrapper...

Error: TestCsharp.EWrapperImpl' does not implement interface member 'IBApi.EWrapper.currentTime(long)

...but it doesn't, so...

you need to provide at least an empty shell of the method declared in EWrapper but I don't know how to do this. I wonder if it is a basic delaration that can be done in EWrapper ?

Implementing an interface is a way of saying, "My class has these methods."

EWrapperImpl needs to have a method called currentTime that matches the declaration in EWrapper; i.e., it has the same parameter and return types.

Votes + Comments
supported.
0

Implement interface member is a way of saying my class has these methods. If it is an interface, then its a convention to name then with an I - eg IEwrapper.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.