Click here to Skip to main content
16,013,918 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 5:58
Robert A. T. Káldy9-Mar-04 5:58 
GeneralRe: How to declare class Member with template declaration ? Pin
vgrigor9-Mar-04 6:09
vgrigor9-Mar-04 6:09 
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 
vgrigor wrote:
Need access to still undefined member, that will
be defined when template will be actually instatiated.


You have an undefined member in the base class, to which you need access from a derived class ? That sounds completely crazy, are you developing both the base class and the derived class simultaneously ?

If your base class has a pure virtual method, you can always create an object of the derived class, then cast a pointer into the base class, and call the virtual method. It must be defined in the derived class in order for this call to succeed.

In the case of the derived class (Derived, in this case), it derives from both Base1 and Base_Accessor template. The protected member of the base class is not derived, but it exists in the class derivation chain. This means that if you implement handling functions (Get & Set) for the base class, you can then call these functions to manipulate or get a pointer to the base class protected member, and thus modify it.

If this doesn't help, then could you explain in more detail what you mean with 'access to still undefined member'. If a member function/variable is not declared inside the class context, it does not exist, and thus cannot be accessed in any way. This means that you must at least declare all members of classes which you wish to use. This applies to both templates and standard classes.

Also, when posting a reply, and if writing code, please use a <PRE> </PRE> section to isolate the code. Also, use the 'Formatting' commands found above the smileys below the text areas. This allows you to use e.g. the < and > symbols properly, which are of key importance when writing this type of code. This makes your code much more readable and understandable.

-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
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 
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 

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.