It's necessary to add 1 to length to account for the endl character. Without adding the 1, nothing prints on the line.

I've partially solved the problem of inputing the password. The above code successfully inputs user data such as ID and User Name, but fails while trying to input the password. I changed the code so the input looks like this for the password:

keybd_event( 0x31, 0,0,0);
keybd_event( 0x31, 0, KEYEVENTF_KEYUP, 0);
etc.

where 0x31 is the byte equivalent of the 1 character.

Not sure why the password input requires this, but it works. Now the problem is how to pack the series of 0x** characters into a QByteArray so I can pass this to the sendString subroutine.