Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / June 2005

Tip: Looking for answers? Try searching our database.

Calling a parent class method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
- vhannak - 29 Jun 2005 03:34 GMT
I have a class (sharedClass) that is instantiated (not derived) by two other
classes (guiClassA and guiClassB).  The sharedClass needs to be able to call
a method that is defined in its parent class (guiClass).  

Specifically, when guiClassA or guiClassB calls a method from the
sharedClass, the sharedClass needs to log its actions by sending strings to
the guiClass (via guiClass method calls), which in turn display or record
this log information in their own unique ways.  

How can the sharedClass call out a function from its parent class without
knowing exactly what kind of class the parent class is?  (I can however
guarantee that the parent class will implement the logging function).

Since both guiClasses are not used in the same application, I was able to
solve this  in C++ by declaring the logging function prototype in a header
file that was included by all the classes, and then defining the function
implementation at the same level as the guiClass was instantiated.  Thus, the
connection was made by the linker.  Is there any way to do something similar
in C#?
- vhannak - 29 Jun 2005 03:37 GMT
Sorry, this was inadvertently submitted to the wrong group.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.