Click here to Skip to main content
15,392,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C CODE FOR RUNNING TWO SENSORS FOR BI-DIRECTIONAL COUNTING Pin
Tr@v7-Nov-12 7:47
MemberTr@v7-Nov-12 7:47 
GeneralRe: C CODE FOR RUNNING TWO SENSORS FOR BI-DIRECTIONAL COUNTING Pin
STEVE10K8-Nov-12 3:41
MemberSTEVE10K8-Nov-12 3:41 
GeneralRe: C CODE FOR RUNNING TWO SENSORS FOR BI-DIRECTIONAL COUNTING Pin
STEVE10K3-Dec-12 2:49
MemberSTEVE10K3-Dec-12 2:49 
QuestionC++ question. Please help me out Pin
Member 88567522-Nov-12 9:06
MemberMember 88567522-Nov-12 9:06 
AnswerRe: C++ question. Please help me out Pin
jeron12-Nov-12 9:18
Memberjeron12-Nov-12 9:18 
AnswerRe: C++ question. Please help me out Pin
Richard MacCutchan2-Nov-12 10:23
mveRichard MacCutchan2-Nov-12 10:23 
AnswerRe: C++ question. Please help me out Pin
Amarnath S3-Nov-12 20:49
professionalAmarnath S3-Nov-12 20:49 
Questionhow to return value after user input Pin
Member 21198442-Nov-12 5:11
MemberMember 21198442-Nov-12 5:11 
Hi All,

i need to return input value after press enter. how to make it. need little help.
the main think here that i have to make function that return value after press Enter.

here is link of project file.

https://skydrive.live.com/redir?resid=78B222720843DE16!116&authkey=!AAjKOKZHSd-q9lI

i have a dialog box with 2 EditBox (m_TxInput and m_TxOutPut) and 2 Button for (GetString and GetNumber)

i made class CMyTextBox for m_TxInput . here is code below. i have 2 function GetString and GetNumber in CMyTextBox Class. i am calling these function on button down in dlg.
C++
/////////////////////////////////////////////////////////////////////////////
// CMyTextBox window

class CMyTextBox : public CEdit
{
// Construction
public:
	CMyTextBox();

// Attributes
public:

// Operations
public:

	bool InFlag; // After Press Enter InFlag = true;
	CString RetVal; // store return value

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyTextBox)
	//}}AFX_VIRTUAL

// Implementation
public:
	CString GetString();
	double GetNumber();
	virtual ~CMyTextBox();

	// Generated message map functions
protected:
	//{{AFX_MSG(CMyTextBox)
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};


// CPP file======================================================

// CMyTextBox message handlers

void CMyTextBox::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
    // TODO: Add your message handler code here and/or call default
    if (nFlags == 28) // Enter press
        GetWindowText(RetVal);
    CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
}

double CMyTextBox::GetNumber()
{
// how to get return here after press enter by user
    if (InFlag == true)
        return atof(RetVal);
    return 0;
}

CString CMyTextBox::GetString()
{
// how to get return here after press enter by user
    if (InFlag == true)
        return RetVal;
    return "";
}


Thanks

Amrit

modified 2-Nov-12 14:29pm.

AnswerRe: how to return value after user input Pin
Richard MacCutchan2-Nov-12 6:25
mveRichard MacCutchan2-Nov-12 6:25 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 8:16
MemberMember 21198442-Nov-12 8:16 
GeneralRe: how to return value after user input Pin
Richard MacCutchan2-Nov-12 10:19
mveRichard MacCutchan2-Nov-12 10:19 
AnswerRe: how to return value after user input Pin
Santhosh G_2-Nov-12 6:34
MemberSanthosh G_2-Nov-12 6:34 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 7:51
MemberMember 21198442-Nov-12 7:51 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 15:32
MemberSanthosh G_2-Nov-12 15:32 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 17:19
MemberMember 21198442-Nov-12 17:19 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 17:26
MemberSanthosh G_2-Nov-12 17:26 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 17:33
MemberMember 21198442-Nov-12 17:33 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 18:01
MemberSanthosh G_2-Nov-12 18:01 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 18:34
MemberMember 21198442-Nov-12 18:34 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 18:43
MemberSanthosh G_2-Nov-12 18:43 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 20:02
MemberMember 21198442-Nov-12 20:02 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 20:27
MemberSanthosh G_2-Nov-12 20:27 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 21:05
MemberMember 21198442-Nov-12 21:05 
GeneralRe: how to return value after user input Pin
Santhosh G_2-Nov-12 21:41
MemberSanthosh G_2-Nov-12 21:41 
GeneralRe: how to return value after user input Pin
Member 21198442-Nov-12 23:24
MemberMember 21198442-Nov-12 23:24 

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.