create control of class CEdit
-
MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }
-
MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }
1/ What's your question 2/ Include resource.h? Your compiler is saying "ID_EXTRA_EDIT? Never heard of it" 3/ Check your spelling. Iain.
In the process of moving to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[^]
-
MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }
Yes, and ? Just define ID_EXTRA_EDIT in your resource.h file.
Cédric Moonen Software developer
Charting control [v2.0 - Updated] OpenGL game tutorial in C++ -
MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }
First I am a Chinese boy. My English is not very good. change m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier for m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, 1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier the meaning is Specifies the edit control’s ID.(msdn) then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost. sorry,my English is so poor...
-
First I am a Chinese boy. My English is not very good. change m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier for m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, 1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier the meaning is Specifies the edit control’s ID.(msdn) then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost. sorry,my English is so poor...
blueapplezh wrote:
then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost.
Yes, that's correct, I didn't see that at all.
blueapplezh wrote:
change m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier for m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, 1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier the meaning is Specifies the edit control’s ID.(msdn)
I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice.
Cédric Moonen Software developer
Charting control [v2.0 - Updated] OpenGL game tutorial in C++ -
blueapplezh wrote:
then you will change m_edit as a class member,because, when the OnBnClickedButton1 is finished m_edit is lost.
Yes, that's correct, I didn't see that at all.
blueapplezh wrote:
change m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier for m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, 1234); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier the meaning is Specifies the edit control’s ID.(msdn)
I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice.
Cédric Moonen Software developer
Charting control [v2.0 - Updated] OpenGL game tutorial in C++I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice. You are clever,I have advise that,but my English is too poor to express my opinion. If I am a USA boy ,HOHO~~~~~
-
I wouldn't advise that. The reason is that it is much safer to add a new Id in the resource.h file and use it. This way you have a central place where you define all your ID's and you can make sure you won't reuse the same Id twice. You are clever,I have advise that,but my English is too poor to express my opinion. If I am a USA boy ,HOHO~~~~~
blueapplezh wrote:
You are clever,I have advise that,but my English is too poor to express my opinion.
I would advise you to use the '
Quote Selected Text
' button to report the words of the post you're replying to. :rolleyes: :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
MFC, STUDIO 2008, MDI-project void CPage1::OnBnClickedButton1() { CRect rect(85, 110, 180, 210); CEdit m_edit; // Embedded edit object m_edit.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | WS_BORDER, rect, this, ID_EXTRA_EDIT); // error C2065: 'ID_EXTRA_EDIT' : undeclared identifier m_edit.SetFocus(); }
#define ID_EXTRA_EDIT 3000 is your answer and also I saw one more thing in your code you must declare CEdit m_edit out of this function.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
blueapplezh wrote:
You are clever,I have advise that,but my English is too poor to express my opinion.
I would advise you to use the '
Quote Selected Text
' button to report the words of the post you're replying to. :rolleyes: :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]CPallini wrote:
I would advise you to use the 'Quote Selected Text' button to report the words of the post you're replying to. Roll eyes Smile
Thanks very mu :-D ch!!!