Click here to Skip to main content
15,914,327 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionStatic Pin
Waldermort9-Nov-06 4:28
Waldermort9-Nov-06 4:28 
AnswerRe: Static Pin
Cedric Moonen9-Nov-06 4:46
Cedric Moonen9-Nov-06 4:46 
GeneralRe: Static Pin
Niklas L9-Nov-06 4:56
Niklas L9-Nov-06 4:56 
GeneralRe: Static Pin
Waldermort9-Nov-06 5:27
Waldermort9-Nov-06 5:27 
GeneralRe: Static Pin
Blake Miller9-Nov-06 7:08
Blake Miller9-Nov-06 7:08 
GeneralRe: Static Pin
Waldermort9-Nov-06 8:32
Waldermort9-Nov-06 8:32 
GeneralRe: Static Pin
Blake Miller9-Nov-06 8:38
Blake Miller9-Nov-06 8:38 
QuestionOnKeyDown in dialog app... Pin
xkrja9-Nov-06 4:15
xkrja9-Nov-06 4:15 
Hi,
I've created a dialog application with only some static text modified so it should count the number of times a button is pressed. The text is the only thing in the dialog window.

I create an OnKeyDown-function to be used for keys being pressed. The problem is that nothing is shown in the dialog window when a key is pressed. I post my code to see if anyone can help me. What I want to happen is that the counter is counting as long as a specific key is pressed.

void CTry_6Dlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) <br />
{<br />
	// TODO: Add your message handler code here and/or call default<br />
	if (nChar == VK_F3) {<br />
		m_strCount.Format("%d", iCount);<br />
		UpdateData(FALSE);<br />
		iCount++;<br />
	}<br />
	<br />
	CDialog::OnKeyDown(nChar, nRepCnt, nFlags);<br />
}


m_strCount is a CString connected to the static text and iCount is the counter that should be shown. I'm sure it is a simple question but since I'm a newbie to VC++ I can't figure it out.

Thanks for any help!
AnswerRe: OnKeyDown in dialog app... Pin
Rage9-Nov-06 4:31
professionalRage9-Nov-06 4:31 
GeneralRe: OnKeyDown in dialog app... Pin
xkrja9-Nov-06 4:47
xkrja9-Nov-06 4:47 
GeneralRe: OnKeyDown in dialog app... Pin
TClarke9-Nov-06 5:04
TClarke9-Nov-06 5:04 
GeneralRe: OnKeyDown in dialog app... Pin
xkrja9-Nov-06 10:53
xkrja9-Nov-06 10:53 
GeneralRe: OnKeyDown in dialog app... Pin
TClarke9-Nov-06 23:35
TClarke9-Nov-06 23:35 
GeneralRe: OnKeyDown in dialog app... Pin
xkrja10-Nov-06 4:26
xkrja10-Nov-06 4:26 
QuestionDebug Assertion Failed dbgdel.cpp Line 45 Pin
nahitan9-Nov-06 4:13
nahitan9-Nov-06 4:13 
AnswerRe: Debug Assertion Failed dbgdel.cpp Line 45 Pin
Rage9-Nov-06 4:33
professionalRage9-Nov-06 4:33 
GeneralRe: Debug Assertion Failed dbgdel.cpp Line 45 Pin
Mark Salsbery9-Nov-06 5:11
Mark Salsbery9-Nov-06 5:11 
GeneralRe: Debug Assertion Failed dbgdel.cpp Line 45 Pin
nahitan9-Nov-06 6:06
nahitan9-Nov-06 6:06 
AnswerRe: Debug Assertion Failed dbgdel.cpp Line 45 Pin
Mark Salsbery9-Nov-06 6:14
Mark Salsbery9-Nov-06 6:14 
GeneralRe: Debug Assertion Failed dbgdel.cpp Line 45 Pin
David Crow9-Nov-06 6:23
David Crow9-Nov-06 6:23 
GeneralRe: Debug Assertion Failed dbgdel.cpp Line 45 Pin
nahitan9-Nov-06 8:40
nahitan9-Nov-06 8:40 
QuestionDebug Assertion Failed dbgdel.cpp Line 42 Pin
nahitan9-Nov-06 4:11
nahitan9-Nov-06 4:11 
QuestionRe: Debug Assertion Failed dbgdel.cpp Line 42 Pin
David Crow9-Nov-06 4:18
David Crow9-Nov-06 4:18 
AnswerRe: Debug Assertion Failed dbgdel.cpp Line 42 Pin
Cedric Moonen9-Nov-06 4:37
Cedric Moonen9-Nov-06 4:37 
QuestionIs it possible to get draw/redraw region Pin
Toubou9-Nov-06 4:01
Toubou9-Nov-06 4:01 

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.