Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
AddExtender("WWINT44I.DLL") isconnected=iGetConState(0)On of my client, under Win2K always gets a false value for isconected even though he can access the Web through IE. Am I missing something?
You cannot rely solely on the fact that iGetConState returning TRUE means that you have a valid active Internet connection. It is impossible for iGetConState to determine if the entire connection to the Internet is functioning without sending a request to a server. This is why you need to send a request to determine if you are really connected or not. You can be assured however that if iGetConState returns TRUE, that attempting your connection will NOT cause you to be prompted to connect to the default Internet Service Provider.
Be aware that iGetConState only reports the status of the default Internet connectoid on Internet Explorer 4.x. If a nondefault connectoid is connected, iGetConState always returns FALSE (unless a LAN connection is used). With Internet Explorer 4.x configured to use a LAN connection, iGetConState always returns TRUE.
Internet Explorer 5 behaves differently. If you are currently dialed into a different dial-up in Internet Explorer 5, iGetConState reports dial-up connection status as long as any connectoid is dialed or an active LAN connection exists.
Here is some sample code that actaully attempts to connect to the internet. It is really the only way to be sure there is a connection.
AddExtender("WWINT44I.DLL") If iGetConState(0) == @FALSE ; Don't attempt connection or it will bring up the dialog ; ... Exit EndIf ERROR_NAME_NOT_RESOLVED = 12007 ERROR_CANNOT_CONNECT = 12029 ERROR_TIMEOUT = 12002 ; Attempt connection tophandle=iBegin(0,"","") datahandle=IUrlOpen(tophandle,"http://www.winbatch.com") If datahandle == 0 ; Call failed err = iGetLastError(); If err == ERROR_NAME_NOT_RESOLVED || err == ERROR_CANNOT_CONNECT || err == ERROR_TIMEOUT ; probably not connected...handle appropriately ;... Exit EndIf EndIf ; We're connected!!! ; .... Message("Notice","Successfully connected") ;Clean up iClose(datahandle) iClose(tophandle)
Article ID: W16892
File Created: 2017:07:28:12:58:47
Last Updated: 2007:07:03:13:26:43