i have 27015 in a string, and i do atio, i get 325041



port = atoi((LPCSTR)servern.Right(servern.GetLength() - servern.Find(':') - 1));