Just a wild guess here, but is your caps lock on, or num lock or any other key being held down ? Keyboard buffer is what I was thinking here and the conversion is narrowing it down.
I believe that since _ttoi take a tchar string &keyTchar[i] is passing the start of substrings. Just use int key = _ttoi(keyTchar) then use division and modulus to get individual digits if you need them.
//create a key( digit ) counter
int keyCount = 0;
//convert from TCHAR to int
for( int i = 0; i < App::szKey; ++i )
{
if( keyTchar[ i ] == NULL )
break;
key[ i ] = _ttoi( &keyTchar[ i ] );
++keyCount;
}
//create an index counter
int index = keyCount;
////////Break the key in to single digits/////////
for( int i = 0; i < index; ++i )
{
for( int j = 0; j < ( keyCount - 1 ); ++j )
key[ i ] /= 10;
--keyCount;
}
//////////////////////////////////////////////////