I wrote a program to connect to remote unix machine in vbscript. The code is given below.

Dim winsock

Public Function connectToRemoteHost (strHostIP,intHostPortNumber)

set winsock = createobject("MSWINSOCK.Winsock")
winsock.Remotehost = strHostIP
winsock.RemotePort = intHostPortNumber

End Function

connectToRemoteHost ("",9001)

When I execute this program as vbscript program, it executes fine.

But the problem is when I try to execute it from QTP, it does not connect to the remote machine.

Can anybody please help me to know why its not getting executed from QTP?