Click here to Skip to main content
15,908,842 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with loading DLL on a computer that doesn't have VC++ installed... Pin
Not Active31-Dec-01 23:01
mentorNot Active31-Dec-01 23:01 
GeneralRe: Problem with loading DLL on a computer that doesn't have VC++ installed... Pin
Rickard Andersson201-Jan-02 1:57
Rickard Andersson201-Jan-02 1:57 
GeneralRe: Problem with loading DLL on a computer that doesn't have VC++ installed... Pin
The_Server1-Jan-02 2:47
The_Server1-Jan-02 2:47 
GeneralRe: Problem with loading DLL on a computer that doesn't have VC++ installed... Pin
Rickard Andersson201-Jan-02 4:53
Rickard Andersson201-Jan-02 4:53 
Generalwin32 API with c# Pin
kasturirawat31-Dec-01 13:55
kasturirawat31-Dec-01 13:55 
GeneralAuto URL detect Pin
Nnamdi Onyeyiri31-Dec-01 7:40
Nnamdi Onyeyiri31-Dec-01 7:40 
GeneralCompiling DLL in Release Mode Pin
Nnamdi Onyeyiri31-Dec-01 7:37
Nnamdi Onyeyiri31-Dec-01 7:37 
GeneralStatic Binding & Dynamic Binding :: C++ Pin
valikac31-Dec-01 7:15
valikac31-Dec-01 7:15 
Hi.
Is there an advantage to using dynamic binding instead of static binding?

I have both Deitel & Deitel C++ How to Program and Stroustrup's Special Edition. I read all of the first book and finished chapter fifteen of Stroustrup. So I understand virtual functions and virtual base. However, I am not to the point where I can implement virtual functions and virtual base without asking: How do you implement them effectively?

For example, "virtual" only works for pointer and reference. That is completely conceivable. However, it seems you have to declare an object of a derived class and then *cast* a new class from the base class to the derive class just to get it working right.

-----------------
classDerived cDerived = new classDerived;

classBase *cBase = &cDerived;
-----------------

The example above comes straight from Deitel & Deitel. So everything looks okay. What is the point of declaring two separate classes? I understand that the use of "virtual," but I do not understand the performance of "virtual" if you have to declare an object of the derived class and an object of the base class. Under what specific situation do you implement dynamic binding? Please be very specific because I found that neither Deitel & Deitel nor Stroustrup give a convincing example of dynamic binding.

Lastly, I too want to implement dynimic binding if it is possible to declare *one* object of either the base class or the derived class. The following is *not correct*:

------------------------
classBase *cDynamic = new classDerived
------------------------

In other words, *virtual* would be great if there is a way to use it without having to declare two seperate classes like the example from Deitel & Deitel.

Thanks,
Kuphryn
GeneralRe: Static Binding & Dynamic Binding :: C++ Pin
Christian Graus31-Dec-01 10:42
protectorChristian Graus31-Dec-01 10:42 
GeneralRe: Static Binding & Dynamic Binding :: C++ Pin
valikac31-Dec-01 11:56
valikac31-Dec-01 11:56 
GeneralRe: Static Binding & Dynamic Binding :: C++ Pin
2-Jan-02 7:56
suss2-Jan-02 7:56 
GeneralRe: Static Binding & Dynamic Binding :: C++ Pin
valikac2-Jan-02 14:22
valikac2-Jan-02 14:22 
GeneralGraph Pin
Sonu Kapoor31-Dec-01 5:09
Sonu Kapoor31-Dec-01 5:09 
GeneralRe: Graph Pin
Ravi Bhavnani31-Dec-01 5:13
professionalRavi Bhavnani31-Dec-01 5:13 
GeneralCHtmlView Pin
31-Dec-01 4:36
suss31-Dec-01 4:36 
GeneralRe: CHtmlView Pin
Philip Patrick1-Jan-02 2:49
professionalPhilip Patrick1-Jan-02 2:49 
Generalcall a function from more then 1 project Pin
Aviv Halperin31-Dec-01 4:23
Aviv Halperin31-Dec-01 4:23 
GeneralRe: call a function from more then 1 project Pin
Chris Losinger31-Dec-01 4:32
professionalChris Losinger31-Dec-01 4:32 
GeneralLoading function from an exe... Pin
Rickard Andersson2031-Dec-01 3:08
Rickard Andersson2031-Dec-01 3:08 
GeneralRe: Loading function from an exe... Pin
BlackSmith31-Dec-01 5:33
BlackSmith31-Dec-01 5:33 
GeneralMFC Extention DLL - Exporting classes..... Pin
BlackSmith31-Dec-01 2:49
BlackSmith31-Dec-01 2:49 
GeneralRe: MFC Extention DLL - Exporting classes..... Pin
Nnamdi Onyeyiri31-Dec-01 7:18
Nnamdi Onyeyiri31-Dec-01 7:18 
Questionmenu from resource redrawing? Pin
Kuniva31-Dec-01 2:40
Kuniva31-Dec-01 2:40 
AnswerRe: menu from resource redrawing? Pin
567890123431-Dec-01 4:37
567890123431-Dec-01 4:37 
AnswerRe: menu from resource redrawing? Pin
Michael Dunn31-Dec-01 7:09
sitebuilderMichael Dunn31-Dec-01 7:09 

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.