Click here to Skip to main content
15,511,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Help with no default constructor message .. related question Pin
Richard Andrew x6424-Sep-17 11:14
professionalRichard Andrew x6424-Sep-17 11:14 
GeneralRe: Help with no default constructor message .. related question Pin
ForNow24-Sep-17 11:52
ForNow24-Sep-17 11:52 
AnswerRe: Help with no default constructor message .. related question Pin
Richard Andrew x6424-Sep-17 12:07
professionalRichard Andrew x6424-Sep-17 12:07 
GeneralRe: Help with no default constructor message .. related question Pin
ForNow24-Sep-17 12:19
ForNow24-Sep-17 12:19 
AnswerRe: Help with no default constructor message .. related question Pin
Richard Andrew x6424-Sep-17 12:39
professionalRichard Andrew x6424-Sep-17 12:39 
GeneralRe: Help with no default constructor message .. related question Pin
ForNow24-Sep-17 13:52
ForNow24-Sep-17 13:52 
GeneralRe: Help with no default constructor message .. related question found answer Pin
ForNow25-Sep-17 9:35
ForNow25-Sep-17 9:35 
AnswerRe: Help with no default constructor message Pin
Jochen Arndt25-Sep-17 22:30
professionalJochen Arndt25-Sep-17 22:30 
A common solution to add such functionality is adding a KeyStroke member to your Rich Edit derived class and pass the this pointer to the member:
C++
class MyRich public CRichEditCtrl
{
public:
    MyRichyRich(int numlines);
    KeyStroke m_KeyStroke;
};

MyRich::MyRich(int numlines) :
    m_KeyStroke(numlines, this)
{
}
But this will generate a C4355 warning. To avoid that, you can make the KeyStroke member a pointer and allocate it in the constructor:
C++
MyRich::MyRich(int numlines)
{
    m_pKeyStroke = new KeyStroke(numlines, this);
}
or provide an initialisation function:
C++
MyRich::MyRich(int numlines)
{
    m_KeyStroke.Init(numlines, this);
}

Your problem is not the error message from the subject but that you want to access your Rich Edit object before it is created (and did not use this instead).
GeneralRe: Help with no default constructor message Pin
ForNow26-Sep-17 3:18
ForNow26-Sep-17 3:18 
QuestionProblem in loading c run time library in Visual C++ Pin
Member 1192324422-Sep-17 4:28
Member 1192324422-Sep-17 4:28 
AnswerRe: Problem in loading c run time library in Visual C++ Pin
Jochen Arndt22-Sep-17 4:45
professionalJochen Arndt22-Sep-17 4:45 
GeneralRe: Problem in loading c run time library in Visual C++ Pin
Member 1192324422-Sep-17 5:02
Member 1192324422-Sep-17 5:02 
GeneralRe: Problem in loading c run time library in Visual C++ Pin
enhzflep22-Sep-17 8:42
enhzflep22-Sep-17 8:42 
QuestionSyntax error Pin
Vaclav_21-Sep-17 16:28
Vaclav_21-Sep-17 16:28 
AnswerRe: Syntax error Pin
leon de boer21-Sep-17 17:28
leon de boer21-Sep-17 17:28 
GeneralRe: Syntax error Pin
Vaclav_21-Sep-17 18:02
Vaclav_21-Sep-17 18:02 
AnswerRe: Syntax error Pin
Richard MacCutchan21-Sep-17 22:08
mveRichard MacCutchan21-Sep-17 22:08 
GeneralRe: Syntax error Pin
Vaclav_22-Sep-17 8:00
Vaclav_22-Sep-17 8:00 
AnswerRe: Syntax error Pin
Richard MacCutchan22-Sep-17 8:04
mveRichard MacCutchan22-Sep-17 8:04 
AnswerRe: Syntax error Pin
jschell22-Sep-17 9:44
jschell22-Sep-17 9:44 
GeneralRe: Syntax error Pin
Richard MacCutchan22-Sep-17 22:33
mveRichard MacCutchan22-Sep-17 22:33 
GeneralRe: Syntax error Pin
Vaclav_24-Sep-17 5:42
Vaclav_24-Sep-17 5:42 
GeneralRe: Syntax error Pin
Richard MacCutchan24-Sep-17 6:14
mveRichard MacCutchan24-Sep-17 6:14 
GeneralRe: Syntax error Pin
jschell26-Sep-17 7:15
jschell26-Sep-17 7:15 
GeneralRe: Syntax error Pin
Vaclav_28-Sep-17 8:10
Vaclav_28-Sep-17 8:10 

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.