[Migrated content. Thread originally posted on 17 December 2004]
Good Days,Im trying to get working InternetCheckConnection Api, but something is wrong.
This is my code:
77 Flags PIC 9(9) USAGE IS COMP-5.
77 Reserved PIC 9(9) USAGE IS COMP-5.
77 Boolean PIC 9(9) USAGE IS COMP-5.
set environment "dll-convention" to 1
set environment "code_prefix" to "."
move zeroes to Reserved
call "wininet.dll"
call "InternetCheckConnectionA" using "http://www.terra.es", flags, Reserved
giving Boolean
cancel "wininet.dll"
This is the function i want to call:
Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
All works well, it found the dll, found the function and in runtime it take a while to give me the value, like the function is connecting, but if the URL exist or not always return me a value of 0.
dwFlags can be set to FLAG_ICC_FORCE_CONNECTION but i dont know how exactly set this value in cobol or the correct pictures of variables.
Here there is more information:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/internetcheckconnection.asp
Can someone help me?
Thank you very much