Most would use something like TCP OPEN instead of the cconnect line.
Don't use the Registry functions posted recently in the source forum without changing because they can only handle Asciiz keys, not binary.
Code:
zkey1 = "Software\Microsoft\Windows\CurrentVersion\Internet Settings" zkey2 = "EnableAutoDial" 'Binary value: "EnableAutoDial" dType = %REG_BINARY AutoDial = GetRegistryValue(%HKEY_CURRENT_USER, dType, zkey1, zkey2, "") dType = %REG_BINARY IF LEN(AutoDial) THEN SetRegistryValue %HKEY_CURRENT_USER, dType, zkey1, zkey2, MKL$(0) END IF i = cconnect(cli_sock, BYVAL VARPTR(srv_addr), SIZEOF(srv_addr)) IF LEN(AutoDial) THEN IF ASC(AutoDial) <> 0 THEN SetRegistryValue %HKEY_CURRENT_USER, dType, zkey1, zkey2, MKL$(1) END IF END IF IF i = %SOCKET_ERROR THEN 'error code here, else connect was succesfull
Hope this of some use.
Peter.
------------------
Leave a comment: