Determining actual local ip in windows 2000/XP??

Greetings

I wrote a program in delphi 5 a fews months ago that utilized winsock to
determine the local ip of the computer it was running on. When run on a
windows 98 machine, it works perfectly and returns something like
'192.168.1.12'. In windows 2000 however, it returns '127.0.0.1' for the
local ip. How can I get hold of the actual local ip in win2k? Any help would
be greatly appreciated.

Thanking you
Jack D.