Click here to Skip to main content
15,907,687 members
Home / Discussions / C#
   

C#

 
AnswerRe: Socket programming tutorials ? ? ? ? Pin
Mazdak3-Apr-02 7:49
Mazdak3-Apr-02 7:49 
QuestionSockets Broken ?? Pin
3-Apr-02 5:28
suss3-Apr-02 5:28 
AnswerRe: Sockets Broken ?? Pin
James T. Johnson3-Apr-02 21:42
James T. Johnson3-Apr-02 21:42 
GeneralRe: Sockets Broken ?? Pin
4-Apr-02 1:45
suss4-Apr-02 1:45 
QuestionHow to pass values from left frame to right? Pin
3-Apr-02 4:37
suss3-Apr-02 4:37 
AnswerRe: How to pass values from left frame to right? Pin
James T. Johnson3-Apr-02 21:46
James T. Johnson3-Apr-02 21:46 
Generalmultiple inheritance Pin
Mazdak2-Apr-02 22:40
Mazdak2-Apr-02 22:40 
GeneralRe: multiple inheritance Pin
James T. Johnson2-Apr-02 23:20
James T. Johnson2-Apr-02 23:20 
You can't, not directly anyway.

You are limited to one base class, but you can implement as many interfaces as you desire.

The recommended way is to have class1 and class2 be interfaces (or just one of them be an interface). The downside is that it makes it more difficult to extend existing functionality because you have to reimplement everything.

I suppose one solution would be to have interfaces IClass1 and IClass2 then create your classes Class1 which implements IClass1 and Class2 which implements IClass2.

Then your class that "inherits" from Class1 and Class2 implements both interfaces, relegating the method calls back to Class1 and Class2 objects if the base functionality is desired. And since you implement both interfaces you can cast the object to both interfaces as well.

Its not pretty but it should work for the most part.

James

Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971

GeneralRe: multiple inheritance Pin
Nick Parker3-Apr-02 6:45
protectorNick Parker3-Apr-02 6:45 
GeneralRe: multiple inheritance Pin
Dale Thompson3-Apr-02 7:29
Dale Thompson3-Apr-02 7:29 
GeneralRe: multiple inheritance Pin
Nick Parker4-Apr-02 1:36
protectorNick Parker4-Apr-02 1:36 
GeneralRe: multiple inheritance Pin
Dale Thompson4-Apr-02 4:20
Dale Thompson4-Apr-02 4:20 
GeneralRe: multiple inheritance Pin
SimonS3-Apr-02 7:36
SimonS3-Apr-02 7:36 
GeneralSpeech .NET Pin
BLaZiNiX2-Apr-02 16:23
BLaZiNiX2-Apr-02 16:23 
GeneralRe: Speech .NET Pin
SHaroz21-Jun-02 7:36
SHaroz21-Jun-02 7:36 
GeneralProgress control in status bar Pin
paulb2-Apr-02 15:30
paulb2-Apr-02 15:30 
GeneralRe: Progress control in status bar Pin
Nick Parker3-Apr-02 6:49
protectorNick Parker3-Apr-02 6:49 
GeneralYes! Solution to compile MANIFEST resource into EXE ;) Pin
Szymon Pusz2-Apr-02 3:33
Szymon Pusz2-Apr-02 3:33 
GeneralOpacity Pin
Mazdak2-Apr-02 3:30
Mazdak2-Apr-02 3:30 
GeneralRe: Opacity Pin
James T. Johnson2-Apr-02 8:11
James T. Johnson2-Apr-02 8:11 
GeneralRe: Opacity Pin
Mazdak2-Apr-02 8:39
Mazdak2-Apr-02 8:39 
GeneralRe: Opacity Pin
Nick Parker2-Apr-02 13:22
protectorNick Parker2-Apr-02 13:22 
GeneralRe: Opacity Pin
Mazdak2-Apr-02 18:46
Mazdak2-Apr-02 18:46 
Questioncan i "%.1f" in C#? Pin
2-Apr-02 2:33
suss2-Apr-02 2:33 
AnswerRe: can i "%.1f" in C#? Pin
James T. Johnson2-Apr-02 2:44
James T. Johnson2-Apr-02 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.