clavrg
October 11th, 2004, 12:19 PM
Trying compile following snippet yields an error C2039:
namespace M {
public __gc class M {
public:
__delegate void MyDelegate(System::Object * sender);
__event MyDelegate * m;
};
}
error C2039: '__ctor' : is not a member of 'ComPort::ComPort'
The error goes away if I do one of the following:
1) change name of the namespace to a different from class name
2) define a delegate outside of the namespace
3) comment event declaration
Any thoughts on why does it behave that way?
namespace M {
public __gc class M {
public:
__delegate void MyDelegate(System::Object * sender);
__event MyDelegate * m;
};
}
error C2039: '__ctor' : is not a member of 'ComPort::ComPort'
The error goes away if I do one of the following:
1) change name of the namespace to a different from class name
2) define a delegate outside of the namespace
3) comment event declaration
Any thoughts on why does it behave that way?