Click here to Skip to main content
15,900,818 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: opening an .mdb file Pin
Anandi.VC25-Feb-08 5:02
Anandi.VC25-Feb-08 5:02 
GeneralRe: opening an .mdb file Pin
Demian Panello25-Feb-08 4:37
Demian Panello25-Feb-08 4:37 
GeneralRe: opening an .mdb file Pin
Anandi.VC25-Feb-08 5:00
Anandi.VC25-Feb-08 5:00 
GeneralRe: opening an .mdb file Pin
Hamid_RT25-Feb-08 6:50
Hamid_RT25-Feb-08 6:50 
GeneralWay of the messages and effect on other applications Pin
baerten25-Feb-08 2:50
baerten25-Feb-08 2:50 
GeneralRe: Way of the messages and effect on other applications Pin
Dr. Emmett Brown25-Feb-08 5:16
Dr. Emmett Brown25-Feb-08 5:16 
GeneralRe: Way of the messages and effect on other applications Pin
Ali Rafiee25-Feb-08 5:28
Ali Rafiee25-Feb-08 5:28 
GeneralCompiler Warning C4373 about virtual methods Pin
George_George25-Feb-08 2:38
George_George25-Feb-08 2:38 
Hello everyone,


The following code will result in C4373 warning message. In MSDN,

[url]http://msdn2.microsoft.com/en-us/library/bb384874.aspx[/url]

I do not quite understand the following statement,

1. What means "bind"? Putting function pointer into the vtable of the related class?

2. const is ignored in derived class?

--------------------
This means the compiler must bind a function reference to the method in either the base or derived class.

Versions of the compiler prior to Visual C++ 2008 bind the function to the method in the base class, then issue a warning message. Subsequent versions of the compiler ignore the const or volatile qualifier, bind the function to the method in the derived class, then issue warning C4373. This latter behavior complies with the C++ standard.
--------------------

class Base {
public:
	virtual int goo (const int input) {return 200;}
};

class Derived : public Base {
public:
		virtual int goo (int input) {return 200;} // change const property of input parameter
};

int main()
{
	Derived d;
	const int a = 1000;
	d.goo (a); // pass const to non-const

	return 0;
}


Compile warning message,

1>d:\visual studio 2008\projects\test_overriding1\test_overriding1\main.cpp(8) : warning C4373: 'Derived::goo': virtual function overrides 'Base::goo', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
1>        d:\visual studio 2008\projects\test_overriding1\test_overriding1\main.cpp(3) : see declaration of 'Base::goo'


regards,
George
AnswerRe: Compiler Warning C4373 about virtual methods Pin
Rajkumar R25-Feb-08 5:07
Rajkumar R25-Feb-08 5:07 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
George_George25-Feb-08 18:30
George_George25-Feb-08 18:30 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
Matthew Faithfull25-Feb-08 5:41
Matthew Faithfull25-Feb-08 5:41 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
George_George25-Feb-08 18:33
George_George25-Feb-08 18:33 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
Matthew Faithfull25-Feb-08 22:59
Matthew Faithfull25-Feb-08 22:59 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
George_George25-Feb-08 23:35
George_George25-Feb-08 23:35 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
Matthew Faithfull25-Feb-08 23:43
Matthew Faithfull25-Feb-08 23:43 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
George_George26-Feb-08 15:09
George_George26-Feb-08 15:09 
GeneralRe: Compiler Warning C4373 about virtual methods [modified] Pin
Rajkumar R26-Feb-08 3:11
Rajkumar R26-Feb-08 3:11 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
George_George26-Feb-08 15:13
George_George26-Feb-08 15:13 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
Rajkumar R26-Feb-08 19:24
Rajkumar R26-Feb-08 19:24 
GeneralRe: Compiler Warning C4373 about virtual methods Pin
George_George26-Feb-08 21:18
George_George26-Feb-08 21:18 
GeneralCasting ULARGE_INTEGER as FILETIME Pin
Ben Aldhouse25-Feb-08 2:07
Ben Aldhouse25-Feb-08 2:07 
GeneralRe: Casting ULARGE_INTEGER as FILETIME Pin
David Crow25-Feb-08 2:19
David Crow25-Feb-08 2:19 
GeneralRe: Casting ULARGE_INTEGER as FILETIME Pin
Ben Aldhouse25-Feb-08 3:10
Ben Aldhouse25-Feb-08 3:10 
QuestionRe: Casting ULARGE_INTEGER as FILETIME Pin
David Crow25-Feb-08 3:53
David Crow25-Feb-08 3:53 
GeneralRe: Casting ULARGE_INTEGER as FILETIME Pin
Ben Aldhouse25-Feb-08 5:02
Ben Aldhouse25-Feb-08 5:02 

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.