Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: "#USING " in vc++6 ?? Pin
fx920026-Jul-06 1:14
fx920026-Jul-06 1:14 
GeneralRe: "#USING " in vc++6 ?? Pin
Christian Graus26-Jul-06 2:09
protectorChristian Graus26-Jul-06 2:09 
QuestionRe: "#USING " in vc++6 ?? Pin
David Crow26-Jul-06 2:58
David Crow26-Jul-06 2:58 
AnswerRe: "#USING " in vc++6 ?? Pin
Mike Dimmick26-Jul-06 3:36
Mike Dimmick26-Jul-06 3:36 
GeneralUsing VS2005 DLL with VC6 program Pin
hairy_hats26-Jul-06 0:51
hairy_hats26-Jul-06 0:51 
GeneralRe: Using VS2005 DLL with VC6 program Pin
Cedric Moonen26-Jul-06 1:00
Cedric Moonen26-Jul-06 1:00 
GeneralRe: Using VS2005 DLL with VC6 program Pin
hairy_hats26-Jul-06 2:40
hairy_hats26-Jul-06 2:40 
GeneralRe: Using VS2005 DLL with VC6 program Pin
Cedric Moonen26-Jul-06 2:55
Cedric Moonen26-Jul-06 2:55 
GeneralRe: Using VS2005 DLL with VC6 program Pin
Mike Dimmick26-Jul-06 3:33
Mike Dimmick26-Jul-06 3:33 
QuestionWhy it fails? Pin
Sarath C26-Jul-06 0:40
Sarath C26-Jul-06 0:40 
AnswerRe: Why it fails? Pin
Stephen Hewitt26-Jul-06 0:44
Stephen Hewitt26-Jul-06 0:44 
AnswerRe: Why it fails? Pin
David Crow26-Jul-06 3:04
David Crow26-Jul-06 3:04 
GeneralRe: Why it fails? Pin
Zac Howland26-Jul-06 4:21
Zac Howland26-Jul-06 4:21 
GeneralRe: Why it fails? Pin
Saravanan Sundaresan27-Jul-06 2:16
professionalSaravanan Sundaresan27-Jul-06 2:16 
GeneralRe: Why it fails? Pin
David Crow27-Jul-06 3:01
David Crow27-Jul-06 3:01 
GeneralRe: Why it fails? Pin
Zac Howland28-Jul-06 3:51
Zac Howland28-Jul-06 3:51 
QuestionUnmanaged C++, windows service Pin
yoti1126-Jul-06 0:34
yoti1126-Jul-06 0:34 
AnswerRe: Unmanaged C++, windows service Pin
led mike26-Jul-06 5:49
led mike26-Jul-06 5:49 
Questionoverloading an overrided function??? Pin
sawerr26-Jul-06 0:25
sawerr26-Jul-06 0:25 
AnswerRe: overloading an overrided function??? Pin
Mike Dimmick26-Jul-06 3:40
Mike Dimmick26-Jul-06 3:40 
AnswerRe: overloading an overrided function??? Pin
Zac Howland26-Jul-06 4:33
Zac Howland26-Jul-06 4:33 
What you are doing is called hiding. The rules the compiler uses for resolving which method you want have problems when you do this. Scott Meyers gives a good explanation of this in his Effective C++ book.

Basically, since char and int can be implicitly casted to each other, your overload hides the method and makes it almost impossible for the compiler to pick the correct method (it is not a mind reader afterall).

To avoid this issue, write code like this instead:

class Base
{
public:
	virtual void func(char n)
	{
		cout << "base" << endl;
	}
};

class Derived : public Base
{
public:
	virtual void func(char c)
	{
		gfunc(9);
	}

	virtual void gfunc(int n)
	{
		cout << "derived" << endl;
	}
};


If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

QuestionHow to access function in different classes Pin
jadhav12326-Jul-06 0:22
jadhav12326-Jul-06 0:22 
AnswerRe: How to access function in different classes Pin
see me26-Jul-06 0:29
see me26-Jul-06 0:29 
GeneralRe: How to access function in different classes Pin
jadhav12326-Jul-06 1:09
jadhav12326-Jul-06 1:09 
AnswerRe: How to access function in different classes Pin
Hamid_RT26-Jul-06 1:25
Hamid_RT26-Jul-06 1:25 

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.