views:

96

answers:

2

I'm following the tutorial's that come with the SDK for Microsoft Virtual Earth, and when I try to create a plugin like it says, the compiler won't let me.

I'm extending the class Microsoft.MapPoint.PlugIn.PlugIn and it has two abstract methods (that the tutorial doesn't talk about) which I have implemented. However, when I compile it, Visual Studio says

'Microsoft.MapPoint.PlugIns.PlugIn' does not contain a constructor that takes '0' arguments

How can I fix this?

+1  A: 

You probably need to add a constructor that passes something to the base constructor; add:

class Foo : PlugIn {
    public Foo() : base( //****** here
}

when you type base(, intellisense should tell you what you need to give the base-constructor.


edit from searching, you need:

    public Foo (Host host)
        : base(host)
    {
    }
Marc Gravell
A: 

If you have a constructor, you need to ensure that the a base class constructor that exists is being called. By default, I believe the compiler attempts to align constructors one for one, but if that's not the functionality you want or that constructor doesn't exist, you need to define the base class constructor to call.

public Class()
            : base(/*variables here*/)
        { 

        }
Timothy Carter