i am new to programming.. i am now facing a prolem on how to turn the value in the combo box by automatically by using visual c++ 6. let's say the value in the combo box is 5, after i click a button, the value will increase to 10, 15 and so on. i hope somebody can help me out. I know this is easy but i can't figure out how to write this..

Recommended Answers

All 7 Replies

You should post some code to show us that you've tried something. Generally we're a lot more helpful if we see some effort...

I think there is lack of something in the below source code, however, i can't solve it..

int level;

	level = m_strvalue;
	
	level =5;
	PlaySound("3000_0_2.wav",NULL,SND_FILENAME);

	Sleep(1000);
	

	int iResults;
	iResults= MessageBox("Can You hear the tone?",
		"Response Dialog",
		MB_YESNO|MB_ICONINFORMATION);
	switch(iResults)
	{
	case IDNO:
		level = level+5;
	
	break;

	case IDYES:
	MessageBox("Test is completed!");
	break;
	}
}

[confused]How does the code you posted relate to your original question? [/confused]

the source code that i posted above is roughly about how my program run. the main problem that i face now is i dont know how to increase the level value of the combo box by 5 automatically each time i press the "no" button. each level will play different kind of tone.

the source code that i posted above is roughly about how my program run. the main problem that i face now is i dont know how to increase the level value of the combo box by 5 automatically each time i press the "no" button. each level will play different kind of tone.

I don't see the connection between your level and what you are trying to do with sound...
What do you do with this level variable except

level+=5;

Two more things. Can you post the code in which you use this level variable and why do you need combo box except list box? For me list box is more useful in this situation!

void CToneDlg::OnPre()


{
// TODO: Add your control notification handler code here


//Get the current values from the screen
UpdateData(TRUE);


strtone = atoi(m_strcombo);


strtone=0;
PlaySound("3000_0_2.wav",NULL,SND_FILENAME);


Sleep(1000);


loop:
int iResults;
iResults= MessageBox("Can You hear the tone?",
"Response Dialog",
MB_YESNO|MB_ICONINFORMATION);


switch(iResults)
{
case IDNO:


strtone = strtone + 5;



if(strtone == 5){
PlaySound("3000_5_2.wav",NULL,SND_FILENAME);
}
else if(strtone == 10){


PlaySound("3000_10_2.wav",NULL,SND_FILENAME);
}
else if(strtone == 15){


PlaySound("3000_15_2.wav",NULL,SND_FILENAME);
}
else if(strtone == 20){
PlaySound("3000_20_2.wav",NULL,SND_FILENAME);
break;
}
goto loop;
break;


case IDYES:
m_sResults ==strtone;
MessageBox("Test is completed!");
}


UpdateData(FALSE);


}

the above source code is the latest one..however, i still unable to control the value in the combo box. if i want to write out the final value of the tone being played in the edit box, is it possible i just write m_sResults==strtone?
Hope somebody can give me some guide line..thanks..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.