Click here to Skip to main content
16,011,805 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: :confused: PLEASE help me with a simple DOS C++ programming problem Pin
Erik Funkenbusch15-Dec-00 11:50
Erik Funkenbusch15-Dec-00 11:50 
GeneralDirectX screensaver Pin
Amit Dey14-Dec-00 5:23
Amit Dey14-Dec-00 5:23 
Generalownerdraw combobox Pin
13-Dec-00 22:11
suss13-Dec-00 22:11 
GeneralModeless dialogs can be reached even if there's one that is modal Pin
Joan M13-Dec-00 12:01
professionalJoan M13-Dec-00 12:01 
GeneralRe: Modeless dialogs can be reached even if there's one that is modal Pin
Michael Dunn13-Dec-00 19:28
sitebuilderMichael Dunn13-Dec-00 19:28 
GeneralBackground image problem Pin
13-Dec-00 11:18
suss13-Dec-00 11:18 
GeneralRe: Background image problem Pin
13-Dec-00 16:27
suss13-Dec-00 16:27 
GeneralUnusal Visual C++ behavior please help Pin
13-Dec-00 7:20
suss13-Dec-00 7:20 
Hello all

I am wrestling with a strange occurance in Visual C++ and being a newby to it I hope you guys can help.

What I have is 3 differant ways a usercan input the same data , either by a spin control, a slider bar or an edit control box. My goal is to have it where if one is adjused the others adjust as well. I have the code down for a change in the slider bar the edit and spin adjust to that value. If the editcontrol is box is used for entering data then both the sldier and the spinbox are updated as well
BUT when i try and build the function for the ON_SpinChange function I encounter a new problem. The code compiles just fine, however when i run it I get a gray box that pops up saying the following

DEBUG Assertion failed yadda yadda with 3 butons to IGNORE, RETRY or ABORT. and i do no know why this happens
the code for on SpinControlChange
is exactly the same as the OnEditControlChange , just differant data names.

here s the code for both

//on user inputting data into edit control box
void CTripCalculatorDlg::OnChangeEdit1()
{
CString SomeValue;
//value input into edit control = speed2
m_speed2.GetWindowText(SomeValue);

//Convert to an int
int speed2 = atoi(LPCSTR(SomeValue));

//adjust the progress bar position
m_progress.SetPos(speed2);
//adjust the slider bar position
m_slider.SetPos(speed2);
//Adjust the spinvalue
m_spin.SetPos(speed2);
m_spinvalue.SetWindowText(LPCTSTR(SomeValue));

} //THIS ALL WORKS FINE



//on input intothe spincontrol instead of using the spin arrows
void CTripCalculatorDlg::OnChangeSpeed()
{
CString SomeValue2;
//value input into spin control = speed
m_speed.GetWindowText(SomeValue2);

//Convert to an int
int speed = atoi(LPCSTR(SomeValue2));

//adjust the progress bar position
m_progress.SetPos(speed);
//adjust the slider bar position
m_slider.SetPos(speed);
//Adjust the editcontrol box
m_speed2.SetWindowText(LPCTSTR(SomeValue2));

}//THIS GIVES ME THE ASSERTION ERROR BOX

what is the differance betweent hese 2 codes that cause the assertion error?

i am perplexed

thank you in advance

Ed Storey
GeneralRe: Unusal Visual C++ behavior please help Pin
Michael Dunn13-Dec-00 8:00
sitebuilderMichael Dunn13-Dec-00 8:00 
GeneralRe: Unusal Visual C++ behavior please help Pin
Ron Russell13-Dec-00 8:15
Ron Russell13-Dec-00 8:15 
GeneralRe: Unusal Visual C++ behavior please help Pin
13-Dec-00 9:41
suss13-Dec-00 9:41 
GeneralRe: Unusal Visual C++ behavior please help Pin
Ron Russell13-Dec-00 9:53
Ron Russell13-Dec-00 9:53 
GeneralHiding an application from the Tasklist Pin
Ron Russell13-Dec-00 6:14
Ron Russell13-Dec-00 6:14 
GeneralRe: Hiding an application from the Tasklist Pin
13-Dec-00 6:59
suss13-Dec-00 6:59 
GeneralRe: Hiding an application from the Tasklist Pin
Ron Russell13-Dec-00 7:42
Ron Russell13-Dec-00 7:42 
GeneralBackground Image on CListCtrl Pin
Kannan Kalyanaraman12-Dec-00 23:52
Kannan Kalyanaraman12-Dec-00 23:52 
QuestionUpdating Resources under Windows 98/Me???? Pin
12-Dec-00 22:11
suss12-Dec-00 22:11 
QuestionHow to create a window without title bar? Pin
Satervalley12-Dec-00 22:02
Satervalley12-Dec-00 22:02 
AnswerRe: How to create a window without title bar? Pin
Tim Deveaux14-Dec-00 13:27
Tim Deveaux14-Dec-00 13:27 
Questionhow do i make a dialog hidden *before* it gets shown? Pin
12-Dec-00 12:27
suss12-Dec-00 12:27 
AnswerRe: how do i make a dialog hidden *before* it gets shown? Pin
Erik Funkenbusch12-Dec-00 13:25
Erik Funkenbusch12-Dec-00 13:25 
GeneralPortable Encryption API Pin
Alvaro Mendez12-Dec-00 8:15
Alvaro Mendez12-Dec-00 8:15 
GeneralRe: Portable Encryption API Pin
13-Dec-00 7:09
suss13-Dec-00 7:09 
GeneralCalculating Time Pin
12-Dec-00 5:27
suss12-Dec-00 5:27 
GeneralAVIs for CAnimateCtrl Pin
Luis Barreira12-Dec-00 4:00
Luis Barreira12-Dec-00 4:00 

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.