Click here to Skip to main content
15,124,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ question. Please help me out Pin
jeron12-Nov-12 10:18
Memberjeron12-Nov-12 10:18 
AnswerRe: C++ question. Please help me out Pin
Richard MacCutchan2-Nov-12 11:23
mveRichard MacCutchan2-Nov-12 11:23 
AnswerRe: C++ question. Please help me out Pin
Amarnath S3-Nov-12 21:49
professionalAmarnath S3-Nov-12 21:49 
Questionhow to return value after user input Pin
Member 21198442-Nov-12 6:11
MemberMember 21198442-Nov-12 6:11 
AnswerRe: how to return value after user input Pin
Richard MacCutchan2-Nov-12 7:25
mveRichard MacCutchan2-Nov-12 7:25 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 9:16
MemberMember 21198442-Nov-12 9:16 
GeneralRe: how to return value after user input Pin
Richard MacCutchan2-Nov-12 11:19
mveRichard MacCutchan2-Nov-12 11:19 
AnswerRe: how to return value after user input Pin
Santhosh G_2-Nov-12 7:34
MemberSanthosh G_2-Nov-12 7:34 
I felt three problems.
1) InFlag is always false. You have to set it to true from OnKeyDown with Enter key.

C++
if (nFlags == 28) // Enter press
{
InFlag = true;
GetWindowText(RetVal);
}

2) Please ensure you added ON_WM_KEYDOWN() in message map of CMyTextBox class.
3) Normally an Edit control will not get Enter key press, On Enter keypress, focused button click action will be performed.
One option is to change the style of your Edit control to Multi-line. Change MultiLine to true, or enable ES_MULTILINE for the CMyTextBox window style.
Another option is to identify enter keypress from PreTranslateMessage(), if "VK_ENTER" key down is occurred from edit control set your InFlag to true.
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 8:51
MemberMember 21198442-Nov-12 8:51 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 16:32
MemberSanthosh G_2-Nov-12 16:32 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 18:19
MemberMember 21198442-Nov-12 18:19 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 18:26
MemberSanthosh G_2-Nov-12 18:26 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 18:33
MemberMember 21198442-Nov-12 18:33 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 19:01
MemberSanthosh G_2-Nov-12 19:01 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 19:34
MemberMember 21198442-Nov-12 19:34 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 19:43
MemberSanthosh G_2-Nov-12 19:43 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 21:02
MemberMember 21198442-Nov-12 21:02 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 21:27
MemberSanthosh G_2-Nov-12 21:27 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 22:05
MemberMember 21198442-Nov-12 22:05 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 22:41
MemberSanthosh G_2-Nov-12 22:41 
GeneralRe: how to return value after user input Pin
Member 21198443-Nov-12 0:24
MemberMember 21198443-Nov-12 0:24 
GeneralRe: how to return value after user input Pin
Richard MacCutchan3-Nov-12 2:56
mveRichard MacCutchan3-Nov-12 2:56 
GeneralRe: how to return value after user input Pin
Member 21198443-Nov-12 5:40
MemberMember 21198443-Nov-12 5:40 
GeneralRe: how to return value after user input Pin
Richard MacCutchan3-Nov-12 7:07
mveRichard MacCutchan3-Nov-12 7:07 
GeneralRe: how to return value after user input Pin
Member 21198443-Nov-12 8:12
MemberMember 21198443-Nov-12 8:12 

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.