ISupportInitialize - MC++

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have derived my own class from a UpDownBase. Like so:

__gc public class MyNumericUpDown : public UpDownBase, ISupportInitialize
{...}

I created my own custom controls using my derived class. I go to build, and
I receive this error:
error C3141: 'System::ComponentModel::ISupportInitialize' : interfaces only
support public inheritance

I tried to add public in front of ISupportInitialize, but when I go to build
I will then get this error:
error C2259: 'MyNumericUpDown' : cannot instantiate abstract class

The above error occurs at the BeginInit() and EndInit() in
InitializeComponent, for my control:
__try_cast<System::ComponentModel::ISupportInitialize *
(this->nudPlayerHeight))->BeginInit();

For some reason it will not let the control be initialized!

Anybody have an ideas why I'm getting these build errors?

Thanks,
 
ReMEn said:
I tried to add public in front of ISupportInitialize, but when I go to build
I will then get this error:
error C2259: 'MyNumericUpDown' : cannot instantiate abstract class

ISupportInitialize has abstract virtual functions that you must
implement. That's the basic idea behind interfaces. The compiler forces
you to implement an interface, otherwise the class can't be instantiated.

Tom
 
Back
Top