Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

class inheritance

richasrrichasr Member Posts: 4
Hi

I'm quite the beginner when it comes to C++ Builder and i've gotten to the point where my program code is rather long and would like to split certain parts into a seperate unit/form.

I've made sure that the main form inherits the new form and vica versa but I've so far been unable to use any methods in the new form, in the old form. Hope that makes sense

My question is, how do I correctly refer to a foreign method in my main form in order to use it?

Comments

  • bilderbikkelbilderbikkel Member Posts: 754
    : Hi
    :
    : I'm quite the beginner when it comes to C++ Builder and i've gotten
    : to the point where my program code is rather long and would like to
    : split certain parts into a seperate unit/form.
    :
    : I've made sure that the main form inherits the new form and vica
    : versa but I've so far been unable to use any methods in the new
    : form, in the old form. Hope that makes sense
    :
    : My question is, how do I correctly refer to a foreign method in my
    : main form in order to use it?
    :
    My first guess would be that you inherit privately. This will disable the use of the base class' public methods.

    You should inherit publicly:

    [code]
    struct DerivedForm : public BaseForm { };
    [/code]

    See ya, Bilderbikkel
Sign In or Register to comment.