How Can I determine the Connection State of My Local System?
-
My application connects to the internet using functions in ras32.dll I would like to know if my system is connected to the ineternet? I've used the following code but it returns false both when connected or disconnected :( Online() { BOOL bRet; DWORD dwState = 0; DWORD dwSize = sizeof(DWORD); bRet = InternetQueryOption(NULL, INTERNET_OPTION_CONNECTED_STATE, &dwState, &dwSize) && (dwState & INTERNET_STATE_CONNECTED); return bRet; }
-
My application connects to the internet using functions in ras32.dll I would like to know if my system is connected to the ineternet? I've used the following code but it returns false both when connected or disconnected :( Online() { BOOL bRet; DWORD dwState = 0; DWORD dwSize = sizeof(DWORD); bRet = InternetQueryOption(NULL, INTERNET_OPTION_CONNECTED_STATE, &dwState, &dwSize) && (dwState & INTERNET_STATE_CONNECTED); return bRet; }
See the FAQ 8.7 How do I tell if the computer is connected to the Internet?[^] --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Pinky, are you pondering what I'm pondering? I think so Brain, but how will we fit the hamster inside the accordion?