Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling a derived class method from a base class instance

Status
Not open for further replies.

gacaccia

Technical User
May 15, 2002
258
US
i'm using an architecture called dOOdads. it provides a base "businessentity" class from which derived classes are created that map to each table/view in a database. for example, i have a database with a table called "generics" and another called "specifics". in my project, i have a class called "Generics" that derives from "businessentity". the derived class has a method called "loadall" that populates the object with the database records.

i have a form that needs to display the contents of either "generics" or "specifics". my solution was to give the form a member of type "businessentity". then, when i create the form, i assign an instance of the loaded derived "generics" or "specifics" class to the base class form member.

the problem is that once the form has been opened, i need at some point to call the "loadall" method again. but, since the form member is of type "businessentity", the loadall method is not available.

is there some way that i can call "loadall" from the base class instance?
 
found i can solve the problem by using delegates.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top