Exactlt where in the application do you put that code - AfxSocketInit()?