[Webinar] Streamline your web hosting managementRegister Today



Posted on 2000-01-15
Medium Priority
Last Modified: 2013-11-20
Hi All,

I have tried to use the function InternetGetConnectedState like this:

BOOL check = InternetGetConnectedState((unsigned long *)INTERNET_CONNECTION_MODEM, 0) ;

But when I ran my program, an unhandled exception error occured.

I have already included the wininet.h and link the wininet.lib at my projoect.

What is the problem? How can I use this function to check the network connection by modem/LAN.......

Question by:ee_lcpaa
1 Comment
LVL 32

Accepted Solution

jhance earned 100 total points
ID: 2355425
How about this instead:


BOOL check = InternetGetConnectedState(&dwCheck, 0) ;

Think about what you are saying with:


You are using a cast to FORCE a constant into a pointer.  Not the desired result!

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question