Click here to Skip to main content
15,916,042 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCView Window ? Pin
sabdalla807-Apr-09 9:49
sabdalla807-Apr-09 9:49 
QuestionRe: CView Window ? Pin
CPallini7-Apr-09 9:56
mveCPallini7-Apr-09 9:56 
AnswerRe: CView Window ? Pin
sabdalla807-Apr-09 10:34
sabdalla807-Apr-09 10:34 
QuestionHighlighting HTML text Pin
rp_suman7-Apr-09 7:32
rp_suman7-Apr-09 7:32 
AnswerRe: Highlighting HTML text Pin
«_Superman_»7-Apr-09 18:11
professional«_Superman_»7-Apr-09 18:11 
QuestionMembers Named using Template Parameters Pin
Skippums7-Apr-09 5:59
Skippums7-Apr-09 5:59 
AnswerRe: Members Named using Template Parameters Pin
Roger Stoltz7-Apr-09 6:27
Roger Stoltz7-Apr-09 6:27 
GeneralRe: Members Named using Template Parameters Pin
Skippums7-Apr-09 7:19
Skippums7-Apr-09 7:19 
I thought about that as well... there is just some complexity in doing it via inheritance. The most direct way that I can think of going about this is to create protected members in the base class, and write get/set properties for each of the members that I want to have a dynamic name in the inherited class. The code for this would be as follows (the Property class simply allows me to use the syntax "instance.propName" without parentheses):
class base {
private:
    double m_Val;

protected:
    double getVal() {
        return m_Val;
    }

    void setVal(const double other) {
        m_Val = other;
    }

public:
    ...
};

class asdf : public base {
public:
    Property<asdf, double> m_asdf;
    asdf() {
        m_asdf.Container(this);
        m_asdf.Getter(&this->getVal);
        m_asdf.Setter(&this->setVal);
    }
};
Not too terrible.

Sounds like somebody's got a case of the Mondays

-Jeff

AnswerRe: Members Named using Template Parameters Pin
Stuart Dootson7-Apr-09 8:04
professionalStuart Dootson7-Apr-09 8:04 
QuestionMultiple Directories selection Pin
ranjith_adapu7-Apr-09 5:38
ranjith_adapu7-Apr-09 5:38 
QuestionRe: Multiple Directories selection Pin
Michael Schubert7-Apr-09 6:12
Michael Schubert7-Apr-09 6:12 
AnswerRe: Multiple Directories selection Pin
ranjith_adapu7-Apr-09 19:45
ranjith_adapu7-Apr-09 19:45 
QuestionRe: Multiple Directories selection Pin
David Crow7-Apr-09 6:18
David Crow7-Apr-09 6:18 
AnswerRe: Multiple Directories selection Pin
«_Superman_»7-Apr-09 18:17
professional«_Superman_»7-Apr-09 18:17 
QuestionFSM data structure design Pin
syuga7-Apr-09 5:06
syuga7-Apr-09 5:06 
AnswerRe: FSM data structure design Pin
David Crow7-Apr-09 5:11
David Crow7-Apr-09 5:11 
AnswerRe: FSM data structure design Pin
Stuart Dootson7-Apr-09 8:05
professionalStuart Dootson7-Apr-09 8:05 
AnswerRe: FSM data structure design Pin
bulg7-Apr-09 9:36
bulg7-Apr-09 9:36 
AnswerRe: FSM data structure design Pin
Alan Balkany8-Apr-09 3:51
Alan Balkany8-Apr-09 3:51 
QuestionChanging values in dialog boxes Pin
AnithaSubramani7-Apr-09 4:53
AnithaSubramani7-Apr-09 4:53 
AnswerRe: Changing values in dialog boxes Pin
Roger Stoltz7-Apr-09 5:05
Roger Stoltz7-Apr-09 5:05 
QuestionRe: Changing values in dialog boxes Pin
David Crow7-Apr-09 5:12
David Crow7-Apr-09 5:12 
AnswerRe: Changing values in dialog boxes Pin
AnithaSubramani7-Apr-09 18:52
AnithaSubramani7-Apr-09 18:52 
QuestionRe: Changing values in dialog boxes Pin
David Crow8-Apr-09 3:11
David Crow8-Apr-09 3:11 
QuestionDialog box gets hanged.. Pin
AnithaSubramani7-Apr-09 4:43
AnithaSubramani7-Apr-09 4:43 

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.