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

C / C++ / MFC

 
GeneralRe: Handling KeyDown even on Dialog. Pin
grassrootkit28-Mar-09 5:39
grassrootkit28-Mar-09 5:39 
Questionvs2008proeditiongodaytrialedition Pin
samuellhu27-Mar-09 17:09
samuellhu27-Mar-09 17:09 
AnswerRe: vs2008proeditiongodaytrialedition Pin
grassrootkit27-Mar-09 18:50
grassrootkit27-Mar-09 18:50 
QuestionAnnoying RegEnumKeyEx Problem Pin
Baltoro27-Mar-09 6:49
Baltoro27-Mar-09 6:49 
QuestionRe: Annoying RegEnumKeyEx Problem Pin
David Crow27-Mar-09 8:10
David Crow27-Mar-09 8:10 
AnswerRe: Annoying RegEnumKeyEx Problem Pin
Baltoro27-Mar-09 11:37
Baltoro27-Mar-09 11:37 
GeneralRe: Annoying RegEnumKeyEx Problem Pin
Baltoro27-Mar-09 12:02
Baltoro27-Mar-09 12:02 
GeneralSorry, all the text is running off the page display. Pin
Baltoro27-Mar-09 12:37
Baltoro27-Mar-09 12:37 
GeneralRe: Sorry, all the text is running off the page display. Pin
David Crow30-Mar-09 2:50
David Crow30-Mar-09 2:50 
GeneralRe: Annoying RegEnumKeyEx Problem Pin
krmed28-Mar-09 3:41
krmed28-Mar-09 3:41 
GeneralThanks! [modified] Pin
Baltoro28-Mar-09 11:11
Baltoro28-Mar-09 11:11 
QuestionDynamic controls Pin
grassrootkit27-Mar-09 4:30
grassrootkit27-Mar-09 4:30 
AnswerRe: Dynamic controls Pin
David Crow27-Mar-09 5:02
David Crow27-Mar-09 5:02 
GeneralRe: Dynamic controls Pin
grassrootkit27-Mar-09 5:21
grassrootkit27-Mar-09 5:21 
GeneralRe: Dynamic controls Pin
David Crow27-Mar-09 5:24
David Crow27-Mar-09 5:24 
GeneralRe: Dynamic controls Pin
grassrootkit27-Mar-09 7:32
grassrootkit27-Mar-09 7:32 
QuestionRe: Dynamic controls Pin
led mike27-Mar-09 5:24
led mike27-Mar-09 5:24 
QuestionRe: Dynamic controls Pin
David Crow27-Mar-09 5:26
David Crow27-Mar-09 5:26 
AnswerRe: Dynamic controls Pin
led mike27-Mar-09 6:25
led mike27-Mar-09 6:25 
AnswerRe: Dynamic controls Pin
Maximilien27-Mar-09 6:09
Maximilien27-Mar-09 6:09 
Questionwhats wrong with ontimer function? Pin
Aljaz11127-Mar-09 2:31
Aljaz11127-Mar-09 2:31 
Here is my code:
void CtimerDlg::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: Add your message handler code here and/or call default
	
	CString prazno;
	prazno="";
	progres.SetPos(100);

	int j= (rand()%2)+1;
		if(j==1) 
		{	
			m_sEdit=getRandomSymbol1();
			AppendTextToEditCtrl(m_edit, m_sEdit);
			skritEdit.GetWindowText(strGet);
			strGet.MakeUpper();
			
			
		}
		else
		{
			
			m_number=getRandomSymbol2();
			char c[10];
		    _itoa(m_number,c,10);
	              MFCString=c;
			AppendTextToEditCtrl(m_edit, MFCString);
			skritEdit.GetWindowText(strGetN);
		}
	
	
		if(m_sEdit==strGet) stevec1=stevec1+1;
		else stevec2=stevec2+2;

		if(MFCString==strGetN) stevec1=stevec1+1;
		else stevec2=stevec2+2;

		m_sEdit="";
		strGet="";
		m_number=0;
		MFCString="";
		strGetN="";

		skritEdit.SetWindowTextW(prazno);
		UpdateData(FALSE);
		progres.SetPos(0);

	CDialog::OnTimer(nIDEvent);
}

NOTE* skritEdit is CEdit with focuson and hidden where user is typing chars and numbers from keyboard. m_edit is also CEdit but visible where random chars and number are shown.
NOTE2* GetRandomSymbol1 returns char, GetRandomSymbol2 returns int.

And here are buttons that starttime and killtime..
void CtimerDlg::OnBnClickedButton2()
{
	// TODO: Add your control notification handler code here
	CString prazno2;
	prazno2="";
	this->KillTimer(1);
	char e[10];
	itoa(stevec1,e,10);
	CString proba;
	proba=e;
	m_edit.SetWindowTextW(prazno2);
	MessageBox(proba);
	stevec1=0;
	
}

void CtimerDlg::OnBnClickedButton3()
{
	// TODO: Add your control notification handler code here
	this->SetTimer(1,x,0);
	skritEdit.SetFocus();
	slider.EnableWindow(FALSE);

	
}


Can you tell me why stevec1 and stevec2 aren't counting correctly.. in function ontimer there is MFCString always empty..like conversion with itoa wouldn't work..
QuestionRe: whats wrong with ontimer function? Pin
David Crow27-Mar-09 2:55
David Crow27-Mar-09 2:55 
AnswerRe: whats wrong with ontimer function? Pin
Aljaz11127-Mar-09 5:59
Aljaz11127-Mar-09 5:59 
QuestionLPTSTR problem Pin
zakkas248327-Mar-09 0:41
zakkas248327-Mar-09 0:41 
AnswerRe: LPTSTR problem Pin
Niklas L27-Mar-09 0:44
Niklas L27-Mar-09 0:44 

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.