CLI/C++ static constructors

  • Thread starter Thread starter Mark Ingram
  • Start date Start date
M

Mark Ingram

Hi, I am having trouble setting a static property in a static constructor:

public ref class MyClass
{
static property Color DefaultColour;

static MyClass()
{
MyClass::DefaultColor = Color::Black;
}
}

I get the error:

error C2039: 'DefaultColor' : is not a member of 'MyClass'

Where am I going wrong?
 
David said:
You declared the property with British/Canadian spelling (...Colour), but
called it with American spelling (...Color).

Yes, sorry, spotted that about a minute after posting. Long day and all
that ;)

Tried to delete the message in Thunderbird, but appears it got posted
anyway... oh well!
 
Back
Top