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; }
            }


        }
    }

Recommended Answers

All 3 Replies

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

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.

commented: supported. +3

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.