Click here to Skip to main content
15,888,521 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip25-Feb-05 6:00
moredip25-Feb-05 6:00 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
Ryan Binns26-Feb-05 19:10
Ryan Binns26-Feb-05 19:10 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip1-Mar-05 5:46
moredip1-Mar-05 5:46 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
Ravi Bhavnani25-Feb-05 3:55
professionalRavi Bhavnani25-Feb-05 3:55 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip25-Feb-05 5:57
moredip25-Feb-05 5:57 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
cmk25-Feb-05 11:40
cmk25-Feb-05 11:40 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip25-Feb-05 12:04
moredip25-Feb-05 12:04 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
cmk25-Feb-05 16:12
cmk25-Feb-05 16:12 
Then you may want to make the return type an argument instead.
e.g.

class ICamera {
public:  
	virtual  bool  CreateClone( ICamera* &C ) const = 0;
	virtual  bool  f() = 0;
};

class IOrientation { 
public:  
	virtual  bool  CreateClone( IOrientation* &O ) const = 0;
	virtual  bool  f() = 0;
};

class C2DCamera : public ICamera, public IOrientation {
public:  
	virtual  bool  CreateClone( ICamera*      &C ) const  { C = new C2DCamera;  return(true); }
	virtual  bool  CreateClone( IOrientation* &O ) const  { O = new C2DCamera;  return(true); }
	virtual  bool  f()  { return(true); }
};

class C3DCamera : public ICamera, public IOrientation {
public:  
	virtual  bool  CreateClone( ICamera*      &C ) const  { C = new C3DCamera;  return(true); }
	virtual  bool  CreateClone( IOrientation* &O ) const  { O = new C3DCamera;  return(true); }
	virtual  bool  f()  { return(true); }
};

int main(int argc, char* argv[])
{
	C2DCamera      d2;
	C3DCamera      d3;
	ICamera       *i2 = &d2,
	              *i3 = &d3;
	ICamera       *c2 = NULL,
	              *c3 = NULL;

	i2->CreateClone(c2);
	c2->f();

	i3->CreateClone(c3);
	c3->f();

	return 0;
}<pre>
 

...cmk

<small>Save the whales - collect the whole set</small>

GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip1-Mar-05 5:41
moredip1-Mar-05 5:41 
GeneralUSB Port Pin
Member 47204524-Feb-05 11:11
Member 47204524-Feb-05 11:11 
GeneralRe: USB Port Pin
namaskaaram24-Feb-05 21:34
namaskaaram24-Feb-05 21:34 
GeneralAssigning Member Variables to Controls Pin
Veronique72224-Feb-05 10:04
Veronique72224-Feb-05 10:04 
GeneralRe: Assigning Member Variables to Controls Pin
David Crow24-Feb-05 10:31
David Crow24-Feb-05 10:31 
GeneralRe: Assigning Member Variables to Controls Pin
Veronique72224-Feb-05 10:39
Veronique72224-Feb-05 10:39 
GeneralRe: Assigning Member Variables to Controls Pin
wilsonian24-Feb-05 14:09
wilsonian24-Feb-05 14:09 
GeneralRe: Assigning Member Variables to Controls Pin
Veronique72225-Feb-05 2:51
Veronique72225-Feb-05 2:51 
GeneralRe: Assigning Member Variables to Controls Pin
rbid25-Feb-05 21:21
rbid25-Feb-05 21:21 
GeneralTerminate process Pin
superstar441024-Feb-05 9:14
susssuperstar441024-Feb-05 9:14 
GeneralRe: Terminate process Pin
David Crow24-Feb-05 9:19
David Crow24-Feb-05 9:19 
GeneralRe: Terminate process Pin
superstar441024-Feb-05 9:35
susssuperstar441024-Feb-05 9:35 
GeneralRe: Terminate process Pin
David Crow24-Feb-05 9:39
David Crow24-Feb-05 9:39 
GeneralRe: Terminate process Pin
superstar441024-Feb-05 10:21
susssuperstar441024-Feb-05 10:21 
GeneralRe: Terminate process Pin
David Crow24-Feb-05 10:25
David Crow24-Feb-05 10:25 
GeneralRe: Terminate process Pin
superstar441024-Feb-05 10:35
susssuperstar441024-Feb-05 10:35 
GeneralRe: Terminate process Pin
David Crow24-Feb-05 10:38
David Crow24-Feb-05 10:38 

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.