GarySB
asked on
VB6 Internet connection not working on windows 10
My VB6 program does a test to see if the internet connection is presently on. (Works on XP, Vista and Win7). I'm not getting a error, just my msgbox saying to turn the internet on. I verified that it is connected, but my function below is not reading it as on in Win10 for some reason. I even installed my program as administrator.
My two functions are below
declare function uses Lib "wininiet.dll" (byref ipsflags as long, byval dwreserved as long) as long
function notconnected() as boolean
dim ingflags as integer
dim binsetcurrent page as boolean
ingflags = 2
binsetcurrentpage = false
if IsConnectedToInternet (ingflags) then
'connected
notconnected = false
else
'not connected
notconnected = true
endif
endfunction
Function IsConnectedToInternet(Opti onal connectMode as integer) as boolean
on error goto errorhandler
dim flags as long
flags = 2
IsConnectedToInternet = InternetGetConnectedState( flags, 0)
connectMode = flags
exit function
errorhandler:
IsConnectedToInternet = false
end function
Thank You
My two functions are below
declare function uses Lib "wininiet.dll" (byref ipsflags as long, byval dwreserved as long) as long
function notconnected() as boolean
dim ingflags as integer
dim binsetcurrent page as boolean
ingflags = 2
binsetcurrentpage = false
if IsConnectedToInternet (ingflags) then
'connected
notconnected = false
else
'not connected
notconnected = true
endif
endfunction
Function IsConnectedToInternet(Opti
on error goto errorhandler
dim flags as long
flags = 2
IsConnectedToInternet = InternetGetConnectedState(
connectMode = flags
exit function
errorhandler:
IsConnectedToInternet = false
end function
Thank You
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Back.. Did you try replacing INTERNET_STATE_ONLINE with INTERNET_STATE_CONNECTED?
ASKER
I will try the replacement and comment back, Thank You!
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I have recommended this question be closed as follows:
Split:
-- David Johnson CD MVP (https:#a42015486)
-- David Johnson CD MVP (https:#a42060566)
If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
frankhelk
Experts-Exchange Cleanup Volunteer
I have recommended this question be closed as follows:
Split:
-- David Johnson CD MVP (https:#a42015486)
-- David Johnson CD MVP (https:#a42060566)
If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
frankhelk
Experts-Exchange Cleanup Volunteer
ASKER
At this time I would like to upgrade so my program will work on Windows 10.
Can you please answer these last concerns of mine.
1. Is Windows 8 just like Windows 10? What I mean is regarding the instructions you see that I have used in VB6, do you think since my program works on Windows 7 that It will also work on Windows 8 or will I have to upgrade for it to work on Windows 8 too?
(I don't have a Windows 8 computer to try it on)
Note: I downloaded Visual Studio 2017 Community. I also saw in the search results other years like 2015. My goal is to have the least amount of headaches when it imports my program.
2. Is Visual Studio 2017 Community the next version of VB you recommend I upgrade to from VB6 or would the 2015 or earlier version be easier to upgrade to and still allow my program to work on Windows 10 because that is my real goal.
Thank You!