Problems Converting UINT16_T to Long

I'm trying to transfer some data over serial through C++, but it seems like when I convert my uint16_t variable to long, a bunch of numbers get added to the end of the variable.

For instance:
9844 becomes 984465535
10416 becomes 1041665535

I've been creating Long variables from the uint16_t variables. This seems like it's bad practice, based on the results I'm getting

longPOS = long(uinPOS);

Have you tried this?

longPOS = uinPOS;

Seems a lot simpler.

65535 equals 0xFFFF. Using unsigned long would make more sense. Part of the problem might be how you print it.

As you mention C++, is this code for the PC?

Please show all your code; and for both sides.