The first parameter to gethostbyaddr should not be a in_addr but simply your ip address in char format (= inet_addr("1.2.3.4")).
Also, see the example code in the MSDN.