Not sure about the errors but yes you can basically use HSERIN and HSEROUT instead of what you're doing now.
You will need to setup the baud rate and what not at the top of the program but from there it's pretty easy.
I do this type of thing often.
Bookmarks