Click here to Skip to main content
16,010,114 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to declare class Member with template declaration ? Pin
Robert A. T. Káldy9-Mar-04 6:39
Robert A. T. Káldy9-Mar-04 6:39 
GeneralRe: How to declare class Member with template declaration ? Pin
Antti Keskinen9-Mar-04 6:52
Antti Keskinen9-Mar-04 6:52 
GeneralRe: How to declare class Member with template declaration ? Pin
vgrigor9-Mar-04 20:35
vgrigor9-Mar-04 20:35 
GeneralRe: How to declare class Member with template declaration ? Pin
Robert A. T. Káldy9-Mar-04 23:52
Robert A. T. Káldy9-Mar-04 23:52 
GeneralRe: How to declare class Member with template declaration ? Pin
vgrigor10-Mar-04 0:14
vgrigor10-Mar-04 0:14 
GeneralRe: How to declare class Member with template declaration ? Pin
Antti Keskinen9-Mar-04 6:48
Antti Keskinen9-Mar-04 6:48 
GeneralRe: How to declare class Member with template declaration ? Pin
vgrigor9-Mar-04 20:40
vgrigor9-Mar-04 20:40 
GeneralRe: How to declare class Member with template declaration ? Pin
Antti Keskinen9-Mar-04 7:31
Antti Keskinen9-Mar-04 7:31 
There is a round-about way through this, though it breaks the rules of C++ very harshly. You can create two pure virtual methods into the base class for each variable in the derived class. The first variable sets, the second gets, the variable in question. Then implement these methods in the derived class.

Now, your base class member functions can call the virtual functions to return the variables from the derived class, thus having a rudimentary access into the members of the derived class. However, you can no longer declare objects of the base class, as it has pure virtual methods. Only the derived class is available for instantation.

This approach may, or may not work, as I have not tried it myself. I don't know. But following the C++ specification, it should be possible to implement it.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: How to declare class Member with template declaration ? Pin
Michael Dunn9-Mar-04 13:10
sitebuilderMichael Dunn9-Mar-04 13:10 
GeneralRe: How to declare class Member with template declaration ? Pin
Antti Keskinen9-Mar-04 20:28
Antti Keskinen9-Mar-04 20:28 
GeneralRe: How to declare class Member with template declaration ? Pin
vgrigor9-Mar-04 20:47
vgrigor9-Mar-04 20:47 
GeneralRe: How to declare class Member with template declaration ? Pin
Robert A. T. Káldy9-Mar-04 23:38
Robert A. T. Káldy9-Mar-04 23:38 
GeneralRe: How to declare class Member with template declaration ? Pin
Antti Keskinen10-Mar-04 0:28
Antti Keskinen10-Mar-04 0:28 
GeneralRe: How to declare class Member with template declaration ? Pin
vgrigor9-Mar-04 20:52
vgrigor9-Mar-04 20:52 
GeneralRe: How to declare class Member with template declaration ? Pin
Michael Dunn10-Mar-04 3:56
sitebuilderMichael Dunn10-Mar-04 3:56 
GeneralRe: How to declare class Member with template declaration ? Pin
vgrigor10-Mar-04 5:34
vgrigor10-Mar-04 5:34 
GeneralFailed to Create Empty Document Pin
dotbomb9-Mar-04 4:02
dotbomb9-Mar-04 4:02 
GeneralRe: Failed to Create Empty Document Pin
Iain Clarke, Warrior Programmer9-Mar-04 4:46
Iain Clarke, Warrior Programmer9-Mar-04 4:46 
GeneralRe: Failed to Create Empty Document Pin
dotbomb11-Mar-04 5:13
dotbomb11-Mar-04 5:13 
GeneralRe: Failed to Create Empty Document Pin
Iain Clarke, Warrior Programmer11-Mar-04 5:33
Iain Clarke, Warrior Programmer11-Mar-04 5:33 
QuestionHow to change font of Cdialog programmatically ? Pin
vgrigor9-Mar-04 3:46
vgrigor9-Mar-04 3:46 
AnswerRe: How to change font of Cdialog programmatically ? Pin
David Crow9-Mar-04 4:01
David Crow9-Mar-04 4:01 
GeneralRe: How to change font of Cdialog programmatically ? Pin
vgrigor9-Mar-04 4:06
vgrigor9-Mar-04 4:06 
GeneralRe: How to change font of Cdialog programmatically ? Pin
David Crow9-Mar-04 4:21
David Crow9-Mar-04 4:21 
GeneralRe: How to change font of Cdialog programmatically ? Pin
vgrigor9-Mar-04 4:29
vgrigor9-Mar-04 4:29 

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.