LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use GetTCPSystemErrorString()?

Here is a sample of the code I am using:

status = ConnectToTCPServer (&handle, SERVER_PORT, SERVER_IP, TCPhandler, 0, 5000);
if (status < 0)
{
errorString = GetTCPSystemErrorString();
printf (errorString);
}

Now my problem:
Whenever the connection fails the status is set to something less than zero, however, what prints on the screen is "No error". Am I using the GetTCPSystemErrorString() function incorrectly? Please help! TIA.

I'm using LabWindows/CVI 5.5.1 on Windows NT 4.0
0 Kudos
Message 1 of 2
(3,303 Views)
Use the GetTCPErrorString() function instead. If you get a library error not caused by a system failure, then GetTCPSystemErrorString will return "No error". However GetTCPErrorString takes the status returned by a TCP library function and returns an error string based on that error code, which is probably what you want.

Regards,
Azucena
NI
Message 2 of 2
(3,303 Views)