numeric keyboard

Posted:
Mar 24, 2004 @ 11:48pm
by Guest
hi all,
i trie to make a calculator like.
any one can help me how to strore the numbers pressed wit my
(keyboard) , i tried to use TCHAR and _sprintf but not find the whay.
thanks.

Posted:
Mar 25, 2004 @ 6:43pm
by _moadib
On phones you can know that numeric key pressed by charcode, example: '5' - key 5... It work at stationary PC( not NumPad)
Or what u want?

Posted:
Mar 26, 2004 @ 3:16pm
by Presto
by using printf, you're replacing everything in the character string, which is why the 1 is being replaced by 2.
I haven't tried CString myself in any of my PPC apps, but if it works, that would probably be easiest.
Otherwise, you can try concatenation (strcat) (not sure what the unicode version is).
Or, you could use a temporary character string and do your own concatenation:
_stprintf(sTemp, "%s2", m_Saisie);
_stprintf(m_Saisie, "%s", sTemp);
-John