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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top