Click here to Skip to main content
15,920,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: request:using vc++ to write a program on clock Pin
ThatsAlok4-Jun-05 1:56
ThatsAlok4-Jun-05 1:56 
GeneralRe: request:using vc++ to write a program on clock Pin
Tom Archer4-Jun-05 4:27
Tom Archer4-Jun-05 4:27 
GeneralAccessing interfaces without directx Pin
elvis89003-Jun-05 13:32
elvis89003-Jun-05 13:32 
GeneralRe: Accessing interfaces without directx Pin
Trollslayer3-Jun-05 21:13
mentorTrollslayer3-Jun-05 21:13 
GeneralCScrollView sizing oddity Pin
bitznarf3-Jun-05 13:04
bitznarf3-Jun-05 13:04 
GeneralRe: CScrollView sizing oddity Pin
Jack Puppy3-Jun-05 14:59
Jack Puppy3-Jun-05 14:59 
GeneralRe: CScrollView sizing oddity Pin
bitznarf4-Jun-05 14:03
bitznarf4-Jun-05 14:03 
GeneralStack Overflow on Edit Box Pin
Grahamfff3-Jun-05 11:07
Grahamfff3-Jun-05 11:07 
I have an Edit box on a dialog and check the input and arrange for it to be set to the Max or Min value if data entered is out of range.

But I get a Stack Overflow error if say I enter say 999, the routine set the input to 180 which is OK. But I now enter -999 and the stack overflow problem occurs and I dont know why.

The Event Routine on the Edit box is show below:-
#define Value_MAX 180
#define Value_MIN -180

void CDataInput::OnEnChangeValue()
{
	// TODO:  If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.

	// Get the New Value string
	m_cValue.GetWindowText(m_strEditValue);
	// Convert from string to double (floating)
	m_fValue = atof(m_strEditValue.GetBuffer());
	if(m_fValue > Value_MAX)
	{
		m_fValue = Value_MAX;
		g_strNewDataStr.Format("%0.2f", m_fValue);
		m_cValue.SetWindowText(g_strNewDataStr);
	}
	else if(m_fValue <= Value_MIN)
	{
		m_fValue = Value_MIN;
		g_strNewDataStr.Format("%0.2f", m_fValue);
		m_cValue.SetWindowText(g_strNewDataStr); 
	}
}



Also if I just enter -999 I get the Stack Overflow problem.

Can someone explain what I am doing wrong.

grahamfff
GeneralRe: Stack Overflow on Edit Box Pin
Blake Miller3-Jun-05 11:11
Blake Miller3-Jun-05 11:11 
GeneralRe: Stack Overflow on Edit Box Pin
Gary R. Wheeler4-Jun-05 3:21
Gary R. Wheeler4-Jun-05 3:21 
GeneralRe: Stack Overflow on Edit Box Pin
Gary R. Wheeler4-Jun-05 3:36
Gary R. Wheeler4-Jun-05 3:36 
GeneralRe: Stack Overflow on Edit Box Pin
Grahamfff4-Jun-05 8:24
Grahamfff4-Jun-05 8:24 
QuestionGetting a window that uses directdraw? Pin
Programmer_4_L1f33-Jun-05 11:07
Programmer_4_L1f33-Jun-05 11:07 
AnswerRe: Getting a window that uses directdraw? Pin
Azrael.LingChen3-Jun-05 20:23
Azrael.LingChen3-Jun-05 20:23 
GeneralGraying Out Tabs in a Property Page Pin
laiju3-Jun-05 10:38
laiju3-Jun-05 10:38 
GeneralRe: Graying Out Tabs in a Property Page Pin
David Crow3-Jun-05 11:03
David Crow3-Jun-05 11:03 
GeneralNeed help resolving a deadlock Pin
Budric B.3-Jun-05 10:19
Budric B.3-Jun-05 10:19 
GeneralRe: Just found the problem Pin
Budric B.3-Jun-05 11:02
Budric B.3-Jun-05 11:02 
GeneralRe: Just found the problem Pin
Blake Miller3-Jun-05 11:08
Blake Miller3-Jun-05 11:08 
GeneralA question about CBT hook Pin
Gaetano Sferra3-Jun-05 9:10
Gaetano Sferra3-Jun-05 9:10 
GeneralRe: A question about CBT hook Pin
Nilesh K.5-Jun-05 23:32
Nilesh K.5-Jun-05 23:32 
GeneralRe: A question about CBT hook Pin
Gaetano Sferra6-Jun-05 0:44
Gaetano Sferra6-Jun-05 0:44 
GeneralRe: A question about CBT hook Pin
Nilesh K.6-Jun-05 16:43
Nilesh K.6-Jun-05 16:43 
GeneralRe: A question about CBT hook Pin
Gaetano Sferra6-Jun-05 21:23
Gaetano Sferra6-Jun-05 21:23 
GeneralNeed help converting this inline asm cosf function for use in a gnu compiler Pin
FocusedWolf3-Jun-05 8:36
FocusedWolf3-Jun-05 8:36 

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.