Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8130277

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:39:14+00:00 2026-06-06T08:39:14+00:00

I want to wait until internet comes so i created a loop with InternetGetConnectedState

  • 0

I want to wait until internet comes so i created a loop with InternetGetConnectedState function.I started program when internet is disabled.Then I enable internet.But still it can ‘t exists.What should i do?

    LPWORD bur;
int abc;
    abc = InternetGetConnectedState(bur,0);
    while (abc==0){
    printf ("zzz");
    if (abc==1)
    break;
    }
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:39:17+00:00Added an answer on June 6, 2026 at 8:39 am

    try putting the call in the loop , abc will never change.

    Also, you shouldn’t assign the result to abc….also, its a DWORD…

    DWORD abc = 0;
    printf ("Waiting for an internet connection.");
     while ((abc & 0x40)){
        InternetGetConnectedState(&abc,0);
        printf (".");
    }
    

    and then comparing it to 1 or 0 is not really going to tell you anything, have a look at the flags it can return :-

    INTERNET_CONNECTION_CONFIGURED
    0x40
    Local system has a valid connection to the Internet, but it might or might not be currently connected.
    INTERNET_CONNECTION_LAN
    0x02
    Local system uses a local area network to connect to the Internet.
    INTERNET_CONNECTION_MODEM
    0x01
    Local system uses a modem to connect to the Internet.
    INTERNET_CONNECTION_MODEM_BUSY
    0x08
    No longer used.
    INTERNET_CONNECTION_OFFLINE
    0x20
    Local system is in offline mode.
    INTERNET_CONNECTION_PROXY
    0x04
    Local system uses a proxy server to connect to the Internet.
    INTERNET_RAS_INSTALLED
    0x10
    Local system has RAS instal
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a for loop wait until my other desired task is
I saw here a solution, but i don't want wait until the key is
I want the program to pause and wait until you press any key to
want to ask user to input something but not want to wait forever. There
NSOperationQueue has waitUntilAllOperationsAreFinished , but I don't want to wait synchronously for it. I
Possible Duplicate: C# Spawn Multiple Threads for work then wait until all finished I
I want to make a method wait until an ActionEvent method has processed before
What nonblocking command makes tcsh wait until a specific background task completes and then
I have a thread downloading data and I want to wait until the download
I'm creating a tftp-like program but instead of stop and wait, I'm trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.