Click here to Skip to main content
16,005,149 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to Implement Q261003 Pin
Steve Jensen1-Sep-02 22:08
Steve Jensen1-Sep-02 22:08 
GeneralColoring Toolbar Pin
Anonymous1-Sep-02 21:20
Anonymous1-Sep-02 21:20 
QuestionHow to display the data in mousemove event of mschart Pin
vcLearner1-Sep-02 21:06
vcLearner1-Sep-02 21:06 
General,NULCWnd Creation failed..!! Pin
Renjith Ramachandran1-Sep-02 19:48
Renjith Ramachandran1-Sep-02 19:48 
GeneralRe: ,NULCWnd Creation failed..!! Pin
Hans Ruck1-Sep-02 22:45
Hans Ruck1-Sep-02 22:45 
GeneralSubtle exception/reference problem Pin
Taka Muraoka1-Sep-02 18:47
Taka Muraoka1-Sep-02 18:47 
GeneralRe: Subtle exception/reference problem Pin
Michael Dunn1-Sep-02 19:19
sitebuilderMichael Dunn1-Sep-02 19:19 
GeneralRe: Subtle exception/reference problem Pin
Taka Muraoka1-Sep-02 19:26
Taka Muraoka1-Sep-02 19:26 
>>> Well, first off you're not using pointers, you're using references. The virtual-ness of fn() is irrelevant because polymorphic calls only happen when dereferencing a pointer.

Not true. Polymorphism still works even if you're using references. For example:

<br />
    D d ; <br />
    B& x = d ; <br />
    x.fn() ; <br />


prints "in D" i.e. even though we are using a B reference, the program knows that we really have a D object and calls the appropriate virtual function.

>>> Second, foo() returns a B&. Since a B& object cannot be implicitly converted to a D& object, the D& catch is not invoked.

As I said, I could understand if this was the case i.e. the compiler uses the *static* type of the exception to determine which catch handler to invoke. What I don't get is why, given that the actual object being thrown is a D, the virtual function mechanism doesn't seem to be working properly. Or at least, as I would expect Smile | :)

One of the guys at work here suggested that the object was being sliced, but since nothing is ever being *copied*, no slicing could possibly be taking place!
GeneralRe: Subtle exception/reference problem Pin
Taka Muraoka1-Sep-02 19:51
Taka Muraoka1-Sep-02 19:51 
GeneralRe: Subtle exception/reference problem Pin
Mike Nordell4-Sep-02 0:11
Mike Nordell4-Sep-02 0:11 
GeneralRasDial query - (newbie level) Pin
Nish Nishant1-Sep-02 18:14
sitebuilderNish Nishant1-Sep-02 18:14 
GeneralRe: RasDial query - (newbie level) Pin
Joaquín M López Muñoz1-Sep-02 20:00
Joaquín M López Muñoz1-Sep-02 20:00 
GeneralRe: RasDial query - (newbie level) Pin
Nish Nishant1-Sep-02 22:44
sitebuilderNish Nishant1-Sep-02 22:44 
GeneralRe: Hint 1 Pin
Masaaki Onishi1-Sep-02 20:10
Masaaki Onishi1-Sep-02 20:10 
GeneralRe: RasDial query - (newbie level) Pin
Victor Vogelpoel2-Sep-02 1:54
Victor Vogelpoel2-Sep-02 1:54 
GeneralRe: RasDial query - (newbie level) Pin
Nish Nishant2-Sep-02 1:59
sitebuilderNish Nishant2-Sep-02 1:59 
Questioniphlpapi.h? Pin
Abin1-Sep-02 18:09
Abin1-Sep-02 18:09 
AnswerRe: iphlpapi.h? Pin
Nish Nishant1-Sep-02 18:16
sitebuilderNish Nishant1-Sep-02 18:16 
GeneralRe: iphlpapi.h? Pin
Abin1-Sep-02 18:23
Abin1-Sep-02 18:23 
GeneralRe: iphlpapi.h? Pin
adara1-Sep-02 18:32
adara1-Sep-02 18:32 
GeneralRe: And more... Pin
Masaaki Onishi1-Sep-02 19:14
Masaaki Onishi1-Sep-02 19:14 
GeneralThanks Pin
Abin2-Sep-02 6:36
Abin2-Sep-02 6:36 
GeneralProblem of Interactive NT Service( Urgent) Pin
hoowaycn1-Sep-02 16:09
hoowaycn1-Sep-02 16:09 
GeneralRe: Problem of Interactive NT Service( Urgent) Pin
Le centriste2-Sep-02 14:54
Le centriste2-Sep-02 14:54 
GeneralC++ and XML Pin
bsamani1-Sep-02 15:22
bsamani1-Sep-02 15:22 

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.