Click here to Skip to main content
15,898,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSetting an event on minimize Pin
Tom Wright13-Apr-05 4:22
Tom Wright13-Apr-05 4:22 
GeneralRe: Setting an event on minimize Pin
Tom Wright13-Apr-05 4:49
Tom Wright13-Apr-05 4:49 
GeneralCTreeCtrl NM_CLICK notification. Pin
Maximilien13-Apr-05 4:08
Maximilien13-Apr-05 4:08 
GeneralRe: CTreeCtrl NM_CLICK notification. Pin
Michael Dunn13-Apr-05 7:31
sitebuilderMichael Dunn13-Apr-05 7:31 
GeneralPure Virtual Function Call Pin
abc87613-Apr-05 3:57
abc87613-Apr-05 3:57 
GeneralRe: Pure Virtual Function Call Pin
digwizfox13-Apr-05 6:49
digwizfox13-Apr-05 6:49 
GeneralRe: Pure Virtual Function Call Pin
Anonymous13-Apr-05 6:59
Anonymous13-Apr-05 6:59 
GeneralRe: Pure Virtual Function Call Pin
digwizfox13-Apr-05 10:45
digwizfox13-Apr-05 10:45 
It's still kind of vague to me what you are doing. Normally, you call the virtual function using the base class pointer. I don't see any reason why having a derived class pointer would cause a problem. But as a design critique, the purpose of virtual functions is to be able to hide dependencies by using the base class pointer to interface to the object. That way, the users of the object are only bound to the base class at compile time. During runtime, the user is unaware that the derived class actually implements the function. There isn't much point in creating a pure virtual function if the users of your object are calling the function from a derived class pointer anyway. That defeats the purpose of run time binding.

You should have some kind of factory build the classes so that the dependency on the derived class is controlled and limited. The actual users of the class that call the functions should get pointers of the base class type from the factory. Then if the implementation needs changed in the future, not as many pieces of your program have to recompile when you make changes.

Maybe you could show us your class declarations and a few code snippets where the function calls are made to give us an example of what you are doing.
GeneralRe: Pure Virtual Function Call Pin
Mike Dimmick13-Apr-05 8:37
Mike Dimmick13-Apr-05 8:37 
GeneralRe: Pure Virtual Function Call Pin
Anonymous13-Apr-05 8:49
Anonymous13-Apr-05 8:49 
GeneralRe: Pure Virtual Function Call Pin
mark novak14-Apr-05 0:38
mark novak14-Apr-05 0:38 
GeneralService Control Manager types with MFC Pin
sweep12313-Apr-05 3:41
sweep12313-Apr-05 3:41 
GeneralRe: Service Control Manager types with MFC Pin
Alexander M.,13-Apr-05 3:55
Alexander M.,13-Apr-05 3:55 
GeneralRe: Service Control Manager types with MFC Pin
sweep12313-Apr-05 4:10
sweep12313-Apr-05 4:10 
GeneralRe: Service Control Manager types with MFC Pin
Ravi Bhavnani13-Apr-05 5:30
professionalRavi Bhavnani13-Apr-05 5:30 
GeneralRe: Service Control Manager types with MFC Pin
sweep12313-Apr-05 5:38
sweep12313-Apr-05 5:38 
Generalproblem with functions and variables... Pin
Green Fuze13-Apr-05 2:35
Green Fuze13-Apr-05 2:35 
GeneralRe: problem with functions and variables... Pin
David Crow13-Apr-05 2:41
David Crow13-Apr-05 2:41 
GeneralRe: problem with functions and variables... Pin
Green Fuze13-Apr-05 13:28
Green Fuze13-Apr-05 13:28 
GeneralRe: problem with functions and variables... Pin
Ryan Binns13-Apr-05 18:28
Ryan Binns13-Apr-05 18:28 
Generalencrypt to database in vc++ Pin
nehathoma13-Apr-05 1:52
nehathoma13-Apr-05 1:52 
GeneralRe: encrypt to database in vc++ Pin
Yulianto.13-Apr-05 15:02
Yulianto.13-Apr-05 15:02 
GeneralRe: encrypt to database in vc++ Pin
ThatsAlok14-Apr-05 19:36
ThatsAlok14-Apr-05 19:36 
GeneralA question on deleting entries in win registry Pin
PrashantJ13-Apr-05 1:24
PrashantJ13-Apr-05 1:24 
GeneralRe: A question on deleting entries in win registry Pin
ThatsAlok13-Apr-05 1:42
ThatsAlok13-Apr-05 1:42 

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.